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