Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginClass.cpp

Issue 5070706781978624: Issue #276 - introduce class BSTR_Argument (Closed)
Patch Set: clarified documentation for operator&, updated to_wstring(CString) Created July 30, 2014, 2:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/COM_Value.cpp ('k') | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
{
« no previous file with comments | « src/plugin/COM_Value.cpp ('k') | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld