Speculative fix for wxWebView unit tests on OSX.

Use stringByEvaluatingJavaScriptFromString as it is guaranteed to return an NSString.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2013-05-05 11:48:47 +00:00
parent 49211791f9
commit ae4adc3d06

View File

@@ -909,16 +909,16 @@ wxString wxWebViewWebKit::GetSelectedSource() const
"var element = document.createElement('div');"
"element.appendChild(range.cloneContents());"
"return element.innerHTML;");
id result = [[m_webView windowScriptObject]
evaluateWebScript:wxNSStringWithWxString(script)];
return wxStringWithNSString([result stringValue]);
NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:
wxNSStringWithWxString(script)];
return wxStringWithNSString(result);
}
wxString wxWebViewWebKit::GetPageText() const
{
id result = [[m_webView windowScriptObject]
evaluateWebScript:@"document.body.textContent"];
return wxStringWithNSString([result stringValue]);
NSString *result = [m_webView stringByEvaluatingJavaScriptFromString:
@"document.body.textContent"];
return wxStringWithNSString(result);
}
void wxWebViewWebKit::EnableHistory(bool enable)