Get the page title from the IHtmlDocument rather than the bowser as it actually returns the title rather than the url.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-07-02 16:41:51 +00:00
parent 968a7de2c5
commit 977c53206a

View 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()