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

Side by Side Diff: src/plugin/PluginUserSettings.cpp

Issue 11062004: Don't use std::string in the plugin, convert when communicating with the engine (Closed)
Patch Set: Created June 27, 2013, 10:37 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 #include "PluginUserSettings.h" 2 #include "PluginUserSettings.h"
3 #include <algorithm> 3 #include <algorithm>
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginClient.h" 5 #include "PluginClient.h"
6 #include "PluginIniFileW.h" 6 #include "PluginIniFileW.h"
7 7
8 static const CString s_GetMessage = L"GetMessage"; 8 static const CString s_GetMessage = L"GetMessage";
9 static const CString s_GetLanguageCount = L"GetLanguageCount"; 9 static const CString s_GetLanguageCount = L"GetLanguageCount";
10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex";
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 pVarResult->bstrVal = SysAllocString(url); 268 pVarResult->bstrVal = SysAllocString(url);
269 } 269 }
270 } 270 }
271 else if (s_GetWhitelistDomains == method) 271 else if (s_GetWhitelistDomains == method)
272 { 272 {
273 if (pDispparams->cArgs) 273 if (pDispparams->cArgs)
274 return DISP_E_BADPARAMCOUNT; 274 return DISP_E_BADPARAMCOUNT;
275 275
276 if (pVarResult) 276 if (pVarResult)
277 { 277 {
278 std::vector<std::string> whiteList = settings->GetWhiteListedDomainList(); 278 std::vector<std::wstring> whiteList = settings->GetWhiteListedDomainList() ;
279 CString sWhiteList; 279 CString sWhiteList;
280 for (size_t i = 0; i < whiteList.size(); i++) 280 for (size_t i = 0; i < whiteList.size(); i++)
281 { 281 {
282 if (!sWhiteList.IsEmpty()) 282 if (!sWhiteList.IsEmpty())
283 { 283 {
284 sWhiteList += ','; 284 sWhiteList += ',';
285 } 285 }
286 sWhiteList += CString(CA2W(whiteList[i].c_str(), CP_UTF8)); 286 sWhiteList += CString(whiteList[i].c_str());
287 } 287 }
288 288
289 pVarResult->vt = VT_BSTR; 289 pVarResult->vt = VT_BSTR;
290 pVarResult->bstrVal = SysAllocString(sWhiteList); 290 pVarResult->bstrVal = SysAllocString(sWhiteList);
291 } 291 }
292 } 292 }
293 else if (s_AddWhitelistDomain == method) 293 else if (s_AddWhitelistDomain == method)
294 { 294 {
295 if (1 != pDispparams->cArgs) 295 if (1 != pDispparams->cArgs)
296 return DISP_E_BADPARAMCOUNT; 296 return DISP_E_BADPARAMCOUNT;
(...skipping 20 matching lines...) Expand all
317 { 317 {
318 settings->RemoveWhiteListedDomain((BSTR)domain); 318 settings->RemoveWhiteListedDomain((BSTR)domain);
319 } 319 }
320 } 320 }
321 else 321 else
322 return DISP_E_MEMBERNOTFOUND; 322 return DISP_E_MEMBERNOTFOUND;
323 323
324 return S_OK; 324 return S_OK;
325 } 325 }
326 326
OLDNEW

Powered by Google App Engine
This is Rietveld