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

Unified Diff: src/plugin/AdblockPlusDomTraverser.cpp

Issue 5070706781978624: Issue #276 - introduce class BSTR_Argument (Closed)
Patch Set: small correction over patch set 2 Created July 29, 2014, 7:22 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/ATL_Deprecate.cpp ('k') | src/plugin/COM_Value.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/AdblockPlusDomTraverser.cpp
===================================================================
--- a/src/plugin/AdblockPlusDomTraverser.cpp
+++ b/src/plugin/AdblockPlusDomTraverser.cpp
@@ -1,5 +1,6 @@
#include "PluginStdAfx.h"
+#include "COM_Value.h"
#include "PluginClient.h"
#include "PluginFilter.h"
#include "PluginSettings.h"
@@ -66,11 +67,10 @@
// Objects
else if (tag == "object")
{
- CComBSTR bstrInnerHtml;
-
- if (SUCCEEDED(pEl->get_innerHTML(&bstrInnerHtml)) && bstrInnerHtml)
+ AdblockPlus::COM::BSTR_Argument inner_HTML;
+ if (SUCCEEDED(pEl->get_innerHTML(&inner_HTML)))
{
- CString sObjectHtml = bstrInnerHtml;
+ CString sObjectHtml = to_CString(inner_HTML);
CString src;
int posBegin = sObjectHtml.Find(L"VALUE=\"");
@@ -122,16 +122,15 @@
if (SUCCEEDED(pEl->get_style(&pStyle)) && pStyle)
{
- CComBSTR bstrDisplay;
-
- if (SUCCEEDED(pStyle->get_display(&bstrDisplay)) && bstrDisplay && CString(bstrDisplay) == L"none")
+ AdblockPlus::COM::BSTR_Argument display;
+ // Explicit call to conversion operator compensates for deficiencies in VS2012
+ if (SUCCEEDED(pStyle->get_display(&display)) && display.operator std::wstring() == L"none")
{
return;
}
- static const CComBSTR sbstrNone(L"none");
-
- if (SUCCEEDED(pStyle->put_display(sbstrNone)))
+ static const AdblockPlus::COM::BSTR_Argument none(std::wstring(L"none"));
+ if (SUCCEEDED(pStyle->put_display(none)))
{
DEBUG_HIDE_EL(indent + L"HideEl::Hiding " + type + L" url:" + url)
« no previous file with comments | « src/plugin/ATL_Deprecate.cpp ('k') | src/plugin/COM_Value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld