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

Unified Diff: src/plugin/PluginUserSettings.cpp

Issue 6248869830590464: Issue 1196 - Fix dealing with boolean VARIANT (Closed)
Patch Set: Created Aug. 12, 2014, 11:10 a.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 | « no previous file | 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
@@ -331,7 +331,7 @@
return DISP_E_BADPARAMCOUNT;
pVarResult->vt = VT_BOOL;
- pVarResult->boolVal = CPluginClient::GetInstance()->IsAcceptableAdsEnabled();
+ pVarResult->boolVal = CPluginClient::GetInstance()->IsAcceptableAdsEnabled() ? VARIANT_TRUE : VARIANT_FALSE;
}
else if (s_SetAcceptableAdsEnabled == method)
{
@@ -341,17 +341,17 @@
if (VT_BOOL != pDispparams->rgvarg[0].vt)
return DISP_E_TYPEMISMATCH;
- bool enable = pDispparams->rgvarg[0].boolVal;
-
- if (enable)
- {
- CPluginClient* client = CPluginClient::GetInstance();
- client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
- }
- else
- {
- CPluginClient* client = CPluginClient::GetInstance();
- client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
+ bool enable = VARIANT_FALSE != pDispparams->rgvarg[0].boolVal;
+
+ if (enable)
+ {
+ CPluginClient* client = CPluginClient::GetInstance();
+ client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
+ }
+ else
+ {
+ CPluginClient* client = CPluginClient::GetInstance();
+ client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
}
}
else if (s_IsUpdate == method)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld