| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 if (pDispparams->rgvarg[0].vt != VT_BSTR || pDispparams->rgvarg[1].vt !=
VT_BSTR) | 177 if (pDispparams->rgvarg[0].vt != VT_BSTR || pDispparams->rgvarg[1].vt !=
VT_BSTR) |
| 178 { | 178 { |
| 179 return DISP_E_TYPEMISMATCH; | 179 return DISP_E_TYPEMISMATCH; |
| 180 } | 180 } |
| 181 if (pVarResult) | 181 if (pVarResult) |
| 182 { | 182 { |
| 183 CComBSTR key = pDispparams->rgvarg[0].bstrVal; | 183 CComBSTR key = pDispparams->rgvarg[0].bstrVal; |
| 184 CComBSTR section = pDispparams->rgvarg[1].bstrVal; | 184 CComBSTR section = pDispparams->rgvarg[1].bstrVal; |
| 185 Dictionary* dictionary = Dictionary::GetInstance(); | 185 Dictionary* dictionary = Dictionary::GetInstance(); |
| 186 std::wstring message = dictionary->Lookup( | 186 std::wstring message = dictionary->Lookup( |
| 187 ToUtf8String(std::wstring(section, ::SysStringLen(section))), | 187 ToUtf8String(ToWstring(section)), |
| 188 ToUtf8String(std::wstring(key, ::SysStringLen(key))) | 188 ToUtf8String(ToWstring(key)) |
| 189 ); | 189 ); |
| 190 | 190 |
| 191 pVarResult->vt = VT_BSTR; | 191 pVarResult->vt = VT_BSTR; |
| 192 pVarResult->bstrVal = SysAllocString(message.c_str()); | 192 pVarResult->bstrVal = SysAllocString(message.c_str()); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 break; | 195 break; |
| 196 case dispatchID_GetLanguageCount: | 196 case dispatchID_GetLanguageCount: |
| 197 { | 197 { |
| 198 if (pDispparams->cArgs != 0) | 198 if (pDispparams->cArgs != 0) |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 return DISP_E_MEMBERNOTFOUND; | 444 return DISP_E_MEMBERNOTFOUND; |
| 445 break; | 445 break; |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 catch (...) | 448 catch (...) |
| 449 { | 449 { |
| 450 return E_FAIL; | 450 return E_FAIL; |
| 451 } | 451 } |
| 452 return S_OK; | 452 return S_OK; |
| 453 } | 453 } |
| OLD | NEW |