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

Unified Diff: src/plugin/AdblockPlusDomTraverser.cpp

Issue 5140323101573120: Issue #276 - introduce classes BSTR_ParamArgument and BSTR_ParamResult (Closed)
Patch Set: Created Aug. 4, 2014, 2:41 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 | « adblockplus.gyp ('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_ParamResult 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_ParamResult 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_ParamArgument 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 | « adblockplus.gyp ('k') | src/plugin/COM_Value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld