From 8f42fec21af87c93689f435b74eb0d79d7486a33 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 22 Oct 2017 00:19:06 +0200 Subject: [PATCH] Pass wxAutomationObject by reference to CallEval() Using pointer here makes no sense: this parameter can never be null and we don't even have the excuse of making it simpler to call like this as the caller has an object and not a pointer to it, so this even results in extra typing. --- src/msw/webview_ie.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 12a98d011e..0dcdd16385 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -880,10 +880,10 @@ bool wxWebViewIE::MSWSetModernEmulationLevel(bool modernLevel) } static -bool CallEval(wxVariant varJavascript, wxAutomationObject* scriptAO, +bool CallEval(wxVariant varJavascript, wxAutomationObject& scriptAO, wxVariant* varResult) { - if ( !scriptAO->Invoke("eval", DISPATCH_METHOD, *varResult, 1, &varJavascript) ) + if ( !scriptAO.Invoke("eval", DISPATCH_METHOD, *varResult, 1, &varJavascript) ) { wxLogWarning(_("Can't run JavaScript")); return false; @@ -915,20 +915,20 @@ bool wxWebViewIE::RunScript(const wxString& javascript, wxString* output) wxVariant varJavascript(wrapJS.GetWrappedCode()); wxVariant varResult; - if ( !CallEval(varJavascript, &scriptAO, &varResult) ) + if ( !CallEval(varJavascript, scriptAO, &varResult) ) return false; if ( varResult.IsType("bool") && varResult.GetBool() ) { varJavascript = wrapJS.GetOutputCode(); - if ( !CallEval(varJavascript, &scriptAO, &varResult) ) + if ( !CallEval(varJavascript, scriptAO, &varResult) ) return false; if ( output != NULL ) *output = varResult.MakeString(); varJavascript = wrapJS.GetCleanUpCode(); - if ( !CallEval(varJavascript, &scriptAO, &varResult) ) + if ( !CallEval(varJavascript, scriptAO, &varResult) ) return false; return true; }