From: Vadim Zeitlin Date: Tue, 16 Jul 2013 14:10:14 +0000 (+0000) Subject: Return raw text, not markup, from wxWebViewWebKit::GetSelectedText(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/54889dae199cb509b525b4c911185d16bef3ea2c Return raw text, not markup, from wxWebViewWebKit::GetSelectedText(). Under OS X the markup string was returned, unlike in all the other ports, resulting in a unit test failure, fix this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 1609dfd59a..17f273603c 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -645,10 +645,11 @@ void wxWebViewWebKit::SetScrollPos(int pos) wxString wxWebViewWebKit::GetSelectedText() const { - NSString* selection = [[m_webView selectedDOMRange] markupString]; - if (!selection) return wxEmptyString; + DOMRange* dr = [m_webView selectedDOMRange]; + if ( !dr ) + return wxString(); - return wxStringWithNSString(selection); + return wxStringWithNSString([dr toString]); } void wxWebViewWebKit::RunScript(const wxString& javascript)