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

Unified Diff: src/plugin/PluginUserSettings.cpp

Issue 6650591174459392: Issues #276, #1163 - introduce class IncomingParam (Closed)
Patch Set: Created July 25, 2014, 11:27 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
« src/plugin/COM_Value.h ('K') | « src/plugin/COM_Value.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginUserSettings.cpp
===================================================================
--- a/src/plugin/PluginUserSettings.cpp
+++ b/src/plugin/PluginUserSettings.cpp
@@ -1,6 +1,7 @@
#include "PluginStdAfx.h"
#include "PluginUserSettings.h"
#include <algorithm>
+#include "COM_Value.h"
#include "PluginSettings.h"
#include "PluginClient.h"
#include "../shared/Dictionary.h"
@@ -142,9 +143,9 @@
if (pVarResult)
{
- CComBSTR key = pDispparams->rgvarg[0].bstrVal;
- CComBSTR section = pDispparams->rgvarg[1].bstrVal;
- CStringW message = sGetMessage((BSTR)section, (BSTR)key);
+ AdblockPlus::COM::Incoming_Param key(pDispparams->rgvarg[0].bstrVal);
+ AdblockPlus::COM::Incoming_Param section(pDispparams->rgvarg[1].bstrVal);
+ CStringW message = sGetMessage(to_CString(section), to_CString(key));
pVarResult->vt = VT_BSTR;
pVarResult->bstrVal = SysAllocString(message);
@@ -241,9 +242,8 @@
if (VT_BSTR != pDispparams->rgvarg[0].vt)
return DISP_E_TYPEMISMATCH;
- CComBSTR url = pDispparams->rgvarg[0].bstrVal;
-
- settings->SetSubscription((BSTR)url);
+ AdblockPlus::COM::Incoming_Param url(pDispparams->rgvarg[0].bstrVal);
+ settings->SetSubscription(url);
}
else if (s_GetLanguage == method)
{
@@ -288,10 +288,10 @@
if (VT_BSTR != pDispparams->rgvarg[0].vt)
return DISP_E_TYPEMISMATCH;
- CComBSTR domain = pDispparams->rgvarg[0].bstrVal;
- if (domain.Length())
+ AdblockPlus::COM::Incoming_Param domain(pDispparams->rgvarg[0].bstrVal);
+ if (!domain.empty())
{
- settings->AddWhiteListedDomain((BSTR)domain);
+ settings->AddWhiteListedDomain(to_CString(domain));
}
}
else if (s_RemoveWhitelistDomain == method)
@@ -302,10 +302,10 @@
if (VT_BSTR != pDispparams->rgvarg[0].vt)
return DISP_E_TYPEMISMATCH;
- CComBSTR domain = pDispparams->rgvarg[0].bstrVal;
- if (domain.Length())
+ AdblockPlus::COM::Incoming_Param domain(pDispparams->rgvarg[0].bstrVal);
+ if (!domain.empty())
{
- settings->RemoveWhiteListedDomain((BSTR)domain);
+ settings->RemoveWhiteListedDomain(to_CString(domain));
}
}
else if (s_GetAppLocale == method)
« src/plugin/COM_Value.h ('K') | « src/plugin/COM_Value.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld