Index: src/plugin/PluginClass.cpp |
=================================================================== |
--- a/src/plugin/PluginClass.cpp |
+++ b/src/plugin/PluginClass.cpp |
@@ -1,6 +1,7 @@ |
#include "PluginStdAfx.h" |
#include "PluginClass.h" |
+#include "COM_Value.h" |
#include "PluginSettings.h" |
#include "PluginSystem.h" |
#ifdef SUPPORT_FILTER |
@@ -218,11 +219,10 @@ |
CComQIPtr<IWebBrowser2> browser = GetBrowser(); |
if (browser) |
{ |
- CComBSTR bstrURL; |
- |
- if (SUCCEEDED(browser->get_LocationURL(&bstrURL))) |
+ AdblockPlus::COM::BSTR_Argument result; |
+ if (SUCCEEDED(browser->get_LocationURL(&result))) |
{ |
- url = bstrURL; |
+ url = to_CString(result); |
CPluginClient::UnescapeUrl(url); |
} |
} |
@@ -507,14 +507,14 @@ |
vFlags.vt = VT_I4; |
vFlags.intVal = navOpenInNewTab; |
- CComBSTR curLoc; |
+ AdblockPlus::COM::BSTR_Argument curLoc; |
browser->get_LocationURL(&curLoc); |
HRESULT hr = browser->Navigate(curLoc, &vFlags, NULL, NULL, NULL); |
if (FAILED(hr)) |
{ |
vFlags.intVal = navOpenInNewWindow; |
- hr = browser->Navigate(CComBSTR(curLoc), &vFlags, NULL, NULL, NULL); |
+ hr = browser->Navigate(curLoc, &vFlags, NULL, NULL, NULL); |
if (FAILED(hr)) |
{ |
DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_NAVIGATION, PLUGIN_ERROR_NAVIGATION, "Navigation::Failed") |
@@ -733,10 +733,10 @@ |
if (pBrowser) |
{ |
CString url; |
- CComBSTR bstrUrl; |
- if (SUCCEEDED(pBrowser->get_LocationURL(&bstrUrl)) && ::SysStringLen(bstrUrl) > 0) |
+ AdblockPlus::COM::BSTR_Argument result; |
+ if (SUCCEEDED(pBrowser->get_LocationURL(&result)) && !result.operator std::wstring().empty()) |
{ |
- url = bstrUrl; |
+ url = to_CString(result); |
CPluginClient::UnescapeUrl(url); |
@@ -1042,8 +1042,7 @@ |
vFlags.vt = VT_I4; |
vFlags.intVal = navOpenInNewTab; |
- CComBSTR navigatePath = CComBSTR(FirstRunPageFileUrl().c_str()); |
- |
+ AdblockPlus::COM::BSTR_Argument navigatePath(FirstRunPageFileUrl()); |
HRESULT hr = GetAsyncBrowser()->Navigate(navigatePath, &vFlags, NULL, NULL, NULL); |
if (FAILED(hr)) |
{ |