Move RunScriptInternal() out of wxWebViewIE and rename
There is no need for this function to be a class member.
This commit is contained in:
parent
b66632fc6d
commit
408ee0523c
@ -200,9 +200,6 @@ private:
|
||||
//Toggles control features see INTERNETFEATURELIST for values.
|
||||
bool EnableControlFeature(long flag, bool enable = true);
|
||||
|
||||
bool RunScriptInternal(wxVariant varJavascript,
|
||||
wxAutomationObject* scriptAO, wxVariant* varResult);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
|
||||
};
|
||||
|
||||
|
@ -879,7 +879,8 @@ bool wxWebViewIE::MSWSetModernEmulationLevel(bool modernLevel)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWebViewIE::RunScriptInternal(wxVariant varJavascript, wxAutomationObject* scriptAO,
|
||||
static
|
||||
bool CallEval(wxVariant varJavascript, wxAutomationObject* scriptAO,
|
||||
wxVariant* varResult)
|
||||
{
|
||||
if ( !scriptAO->Invoke("eval", DISPATCH_METHOD, *varResult, 1, &varJavascript) )
|
||||
@ -914,20 +915,20 @@ bool wxWebViewIE::RunScript(const wxString& javascript, wxString* output)
|
||||
wxVariant varJavascript(wrapJS.GetWrappedCode());
|
||||
wxVariant varResult;
|
||||
|
||||
if ( !RunScriptInternal(varJavascript, &scriptAO, &varResult) )
|
||||
if ( !CallEval(varJavascript, &scriptAO, &varResult) )
|
||||
return false;
|
||||
|
||||
if ( varResult.IsType("bool") && varResult.GetBool() )
|
||||
{
|
||||
varJavascript = wrapJS.GetOutputCode();
|
||||
if ( !RunScriptInternal(varJavascript, &scriptAO, &varResult) )
|
||||
if ( !CallEval(varJavascript, &scriptAO, &varResult) )
|
||||
return false;
|
||||
|
||||
if ( output != NULL )
|
||||
*output = varResult.MakeString();
|
||||
|
||||
varJavascript = wrapJS.GetCleanUpCode();
|
||||
if ( !RunScriptInternal(varJavascript, &scriptAO, &varResult) )
|
||||
if ( !CallEval(varJavascript, &scriptAO, &varResult) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user