]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxWebView compilation in STL build with wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 30 Nov 2011 09:16:44 +0000 (09:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 30 Nov 2011 09:16:44 +0000 (09:16 +0000)
Convert wxString to GTK+ strings explicitly, implicit conversion doesn't
happen in STL build and may be wrong anyhow as it doesn't necessarily convert
the strings to UTF-8 expected by GTK+.

Closes #13703.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/webview_webkit.cpp

index 2ece822c188c3037528d0c94d86468ffd0c8ba82..711850155b98cc9d390f1ef17932ab6ef83f40cf 100644 (file)
@@ -50,7 +50,12 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget,
         //with a custom scheme.
         if(WEBKIT_IS_WEB_HISTORY_ITEM(item) && webkit_web_history_item_get_uri(item) != url)
         {
-            WebKitWebHistoryItem* newitem = webkit_web_history_item_new_with_data(url, webKitCtrl->GetCurrentTitle());
+            WebKitWebHistoryItem*
+                newitem = webkit_web_history_item_new_with_data
+                          (
+                            url.utf8_str(),
+                            webKitCtrl->GetCurrentTitle().utf8_str()
+                          );
             webkit_web_back_forward_list_add_item(hist, newitem);
         }
 
@@ -368,7 +373,7 @@ wxgtk_webview_webkit_resource_req(WebKitWebView *,
             wxString mime = file->GetMimeType();
             wxString path = "data:" + mime + ";base64," + data;
             //Then we can redirect the call
-            webkit_network_request_set_uri(request, path);
+            webkit_network_request_set_uri(request, path.utf8_str());
         }
         
     }
@@ -437,7 +442,7 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
     PostCreation(size);
 
     /* Open a webpage */
-    webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), url);
+    webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), url.utf8_str());
 
     //Get the initial history limit so we can enable and disable it later
     WebKitWebBackForwardList* history;