]> git.saurik.com Git - wxWidgets.git/commitdiff
Get the page title from the IHtmlDocument rather than the bowser as it actually retur...
authorSteve Lamerton <steve.lamerton@gmail.com>
Sat, 2 Jul 2011 16:41:51 +0000 (16:41 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Sat, 2 Jul 2011 16:41:51 +0000 (16:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/webview_ie.cpp

index c3b53be9d88c94e01dfd1a7fbd793a35e02da490..398b4af75c2bd2743aad32660d20fb04ca336ec4 100644 (file)
@@ -504,10 +504,15 @@ wxString wxWebViewIE::GetCurrentURL()
 
 wxString wxWebViewIE::GetCurrentTitle()
 {
-    wxVariant out = m_ie.GetProperty("LocationName");
+    wxVariant documentVariant = m_ie.GetProperty("Document");
+    void* documentPtr = documentVariant.GetVoidPtr();
+    IHTMLDocument2* document = (IHTMLDocument2*)documentPtr;
 
-    wxASSERT(out.GetType() == "string");
-    return out.GetString();
+    wxASSERT(documentPtr && document);
+
+    BSTR title;
+    document->get_nameProp(&title);
+    return wxString(title);
 }
 
 bool wxWebViewIE::CanCut()