From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Quotes/src/CurrencyConverter.cpp | 4 +- plugins/Quotes/src/HTTPSession.cpp | 2 +- plugins/Quotes/src/ImportExport.cpp | 72 +++++++++++----------- plugins/Quotes/src/QuotesProviderBase.cpp | 28 ++++----- plugins/Quotes/src/QuotesProviderDukasCopy.cpp | 4 +- plugins/Quotes/src/QuotesProviderFinance.cpp | 10 +-- plugins/Quotes/src/QuotesProviderGoogle.cpp | 14 ++--- plugins/Quotes/src/QuotesProviderGoogleFinance.cpp | 6 +- plugins/Quotes/src/QuotesProviders.cpp | 2 +- plugins/Quotes/src/SettingsDlg.cpp | 2 +- plugins/Quotes/src/XMLEngineMI.cpp | 4 +- plugins/Quotes/src/stdafx.h | 4 +- 12 files changed, 76 insertions(+), 76 deletions(-) (limited to 'plugins/Quotes') diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp index 45f5628890..c86356aa27 100644 --- a/plugins/Quotes/src/CurrencyConverter.cpp +++ b/plugins/Quotes/src/CurrencyConverter.cpp @@ -107,11 +107,11 @@ INT_PTR CALLBACK CurrencyConverterDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM LRESULT nFrom = ::SendMessage(hcbxFrom, CB_ADDSTRING, 0, reinterpret_cast(pszName)); LRESULT nTo = ::SendMessage(hcbxTo, CB_ADDSTRING, 0, reinterpret_cast(pszName)); - if (0 == mir_tstrcmpi(rQuote.GetID().c_str(), sFromQuoteID.c_str())) { + if (0 == mir_wstrcmpi(rQuote.GetID().c_str(), sFromQuoteID.c_str())) { ::SendMessage(hcbxFrom, CB_SETCURSEL, nFrom, 0); } - if (0 == mir_tstrcmpi(rQuote.GetID().c_str(), sToQuoteID.c_str())) { + if (0 == mir_wstrcmpi(rQuote.GetID().c_str(), sToQuoteID.c_str())) { ::SendMessage(hcbxTo, CB_SETCURSEL, nTo, 0); } } diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp index 16583b071a..fb2ab0d62c 100644 --- a/plugins/Quotes/src/HTTPSession.cpp +++ b/plugins/Quotes/src/HTTPSession.cpp @@ -97,7 +97,7 @@ public: char* pResult = &*(apBuffer.begin()); int nIndex = find_header(pReply, "Content-Type"); if ((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue), "utf-8"))) { - wchar_t* p = mir_utf8decodeT(pResult); + wchar_t* p = mir_utf8decodeW(pResult); rsResponce = p; mir_free(p); } diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index ca9e9440fa..6818c5c879 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -140,25 +140,25 @@ LPCTSTR prepare_filter(LPTSTR pszBuffer, size_t cBuffer) { LPTSTR p = pszBuffer; LPCTSTR pszXml = TranslateT("XML File (*.xml)"); - mir_tstrncpy(p, pszXml, (int)cBuffer); - size_t nLen = mir_tstrlen(pszXml) + 1; + mir_wstrncpy(p, pszXml, (int)cBuffer); + size_t nLen = mir_wstrlen(pszXml) + 1; p += nLen; if (nLen < cBuffer) { - mir_tstrncpy(p, L"*.xml", (int)(cBuffer - nLen)); + mir_wstrncpy(p, L"*.xml", (int)(cBuffer - nLen)); p += 6; nLen += 6; } if (nLen < cBuffer) { LPCTSTR pszAll = TranslateT("All files (*.*)"); - mir_tstrncpy(p, pszAll, (int)(cBuffer - nLen)); - size_t n = mir_tstrlen(pszAll) + 1; + mir_wstrncpy(p, pszAll, (int)(cBuffer - nLen)); + size_t n = mir_wstrlen(pszAll) + 1; nLen += n; p += n; } if (nLen < cBuffer) { - mir_tstrncpy(p, L"*.*", (int)(cBuffer - nLen)); + mir_wstrncpy(p, L"*.*", (int)(cBuffer - nLen)); p += 4; nLen += 4; } @@ -255,13 +255,13 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) std::string s = quotes_t2a(sModuleName.c_str()); dbs.szModule = s.c_str();//T2CA(sModuleName.c_str()); - bool bCListModule = 0 == mir_tstrcmpi(sModuleName.c_str(), L"CList"); + bool bCListModule = 0 == mir_wstrcmpi(sModuleName.c_str(), L"CList"); size_t cChild = pXmlModule->GetChildCount(); for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pSetting = pXmlModule->GetChildNode(i); tstring sSetting = pSetting->GetName(); - if (0 == mir_tstrcmpi(g_pszXmlSetting, sSetting.c_str())) { + if (0 == mir_wstrcmpi(g_pszXmlSetting, sSetting.c_str())) { size_t cSetChild = pSetting->GetChildCount(); if (cSetChild >= 2) { tstring sName; @@ -270,10 +270,10 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) for (size_t j = 0; j < cSetChild; ++j) { IXMLNode::TXMLNodePtr pNode = pSetting->GetChildNode(j); tstring sNode = pNode->GetName(); - if (0 == mir_tstrcmpi(g_pszXmlName, sNode.c_str())) { + if (0 == mir_wstrcmpi(g_pszXmlName, sNode.c_str())) { sName = pNode->GetText(); } - else if (0 == mir_tstrcmpi(g_pszXmlValue, sNode.c_str())) { + else if (0 == mir_wstrcmpi(g_pszXmlValue, sNode.c_str())) { sValue = pNode->GetText(); sType = pNode->GetAttributeValue(g_pszXmlType); } @@ -282,7 +282,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) if ((false == sName.empty()) && (false == sType.empty())) { std::string s1 = quotes_t2a(sName.c_str()); dbs.szSetting = s1.c_str(); - if (0 == mir_tstrcmpi(g_pszXmlTypeByte, sType.c_str())) { + if (0 == mir_wstrcmpi(g_pszXmlTypeByte, sType.c_str())) { tistringstream in(sValue.c_str()); in.imbue(GetSystemLocale()); dbs.value.cVal = in.get(); @@ -292,7 +292,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) ++cCreatedRecords; } } - else if (0 == mir_tstrcmpi(g_pszXmlTypeWord, sType.c_str())) { + else if (0 == mir_wstrcmpi(g_pszXmlTypeWord, sType.c_str())) { tistringstream in(sValue.c_str()); in.imbue(GetSystemLocale()); in >> dbs.value.wVal; @@ -302,7 +302,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) ++cCreatedRecords; } } - else if (0 == mir_tstrcmpi(g_pszXmlTypeDword, sType.c_str())) { + else if (0 == mir_wstrcmpi(g_pszXmlTypeDword, sType.c_str())) { tistringstream in(sValue.c_str()); in.imbue(GetSystemLocale()); in >> dbs.value.dVal; @@ -312,22 +312,22 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) ++cCreatedRecords; } } - else if (0 == mir_tstrcmpi(g_pszXmlTypeAsciiz, sType.c_str())) { - ptrA v(mir_t2a(sValue.c_str())); + else if (0 == mir_wstrcmpi(g_pszXmlTypeAsciiz, sType.c_str())) { + ptrA v(mir_u2a(sValue.c_str())); dbs.value.pszVal = v; dbs.value.type = DBVT_ASCIIZ; if (set_contact_settings(hContact, dbs)) ++cCreatedRecords; } - else if (0 == mir_tstrcmpi(g_pszXmlTypeUtf8, sType.c_str())) { + else if (0 == mir_wstrcmpi(g_pszXmlTypeUtf8, sType.c_str())) { T2Utf szValue(sValue.c_str()); dbs.value.pszVal = szValue; dbs.value.type = DBVT_UTF8; if (set_contact_settings(hContact, dbs)) ++cCreatedRecords; } - else if (0 == mir_tstrcmpi(g_pszXmlTypeWchar, sType.c_str())) { - ptrW val(mir_t2u(sValue.c_str())); + else if (0 == mir_wstrcmpi(g_pszXmlTypeWchar, sType.c_str())) { + ptrW val(mir_wstrdup(sValue.c_str())); dbs.value.pwszVal = val; dbs.value.type = DBVT_WCHAR; if (set_contact_settings(hContact, dbs)) @@ -335,7 +335,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) mir_free(dbs.value.pwszVal); } - else if (0 == mir_tstrcmpi(g_pszXmlTypeBlob, sType.c_str())) { + else if (0 == mir_wstrcmpi(g_pszXmlTypeBlob, sType.c_str())) { unsigned bufLen; mir_ptr buf((PBYTE)mir_base64_decode(_T2A(sValue.c_str()), &bufLen)); if (buf) { @@ -348,7 +348,7 @@ bool handle_module(MCONTACT hContact, const IXMLNode::TXMLNodePtr& pXmlModule) } } - if ((true == bCListModule) && (0 == mir_tstrcmpi(sName.c_str(), L"Group"))) + if ((true == bCListModule) && (0 == mir_wstrcmpi(sName.c_str(), L"Group"))) Clist_GroupCreate(NULL, sValue.c_str()); } } @@ -367,13 +367,13 @@ size_t count_contacts(const IXMLNode::TXMLNodePtr& pXmlRoot, bool bInContactsGro IXMLNode::TXMLNodePtr pNode = pXmlRoot->GetChildNode(i); tstring sName = pNode->GetName(); if (false == bInContactsGroup) { - if (0 == mir_tstrcmpi(g_pszXmlContacts, sName.c_str())) + if (0 == mir_wstrcmpi(g_pszXmlContacts, sName.c_str())) cContacts += count_contacts(pNode, true); else cContacts += count_contacts(pNode, false); } else { - if (0 == mir_tstrcmpi(g_pszXmlContact, sName.c_str())) + if (0 == mir_wstrcmpi(g_pszXmlContact, sName.c_str())) ++cContacts; } } @@ -405,8 +405,8 @@ IXMLNode::TXMLNodePtr find_quotes_module(const IXMLNode::TXMLNodePtr& pXmlContac for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pXmlContact->GetChildNode(i); tstring sName = pNode->GetName(); - if ((0 == mir_tstrcmpi(g_pszXmlModule, sName.c_str())) - && (0 == mir_tstrcmpi(g_sQuotes.c_str(), pNode->GetText().c_str()))) { + if ((0 == mir_wstrcmpi(g_pszXmlModule, sName.c_str())) + && (0 == mir_wstrcmpi(g_sQuotes.c_str(), pNode->GetText().c_str()))) { return pNode; } } @@ -424,10 +424,10 @@ TNameValue parse_setting_node(const IXMLNode::TXMLNodePtr& pXmlSetting) for (size_t j = 0; j < cSettingChildItems; ++j) { IXMLNode::TXMLNodePtr pXMLSetChild = pXmlSetting->GetChildNode(j); if (pXMLSetChild) { - if (0 == mir_tstrcmpi(g_pszXmlName, pXMLSetChild->GetName().c_str())) { + if (0 == mir_wstrcmpi(g_pszXmlName, pXMLSetChild->GetName().c_str())) { sName = pXMLSetChild->GetText(); } - else if (0 == mir_tstrcmpi(g_pszXmlValue, pXMLSetChild->GetName().c_str())) { + else if (0 == mir_wstrcmpi(g_pszXmlValue, pXMLSetChild->GetName().c_str())) { sValue = pXMLSetChild->GetText(); } } @@ -443,9 +443,9 @@ CQuotesProviders::TQuotesProviderPtr find_provider(const IXMLNode::TXMLNodePtr& size_t cChild = pXmlQuotesModule->GetChildCount(); for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pXMLSetting = pXmlQuotesModule->GetChildNode(i); - if (pXMLSetting && (0 == mir_tstrcmpi(g_pszXmlSetting, pXMLSetting->GetName().c_str()))) { + if (pXMLSetting && (0 == mir_wstrcmpi(g_pszXmlSetting, pXMLSetting->GetName().c_str()))) { TNameValue Item = parse_setting_node(pXMLSetting); - if ((0 == mir_tstrcmpi(g_sQuotesProvider.c_str(), Item.first.c_str())) && (false == Item.second.empty())) { + if ((0 == mir_wstrcmpi(g_sQuotesProvider.c_str(), Item.first.c_str())) && (false == Item.second.empty())) { return CModuleInfo::GetInstance().GetQuoteProvidersPtr()->FindProvider(Item.second); } } @@ -486,12 +486,12 @@ bool get_contact_state(const IXMLNode::TXMLNodePtr& pXmlContact, CContactState& size_t cChild = m_pXmlQuotes->GetChildCount(); for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = m_pXmlQuotes->GetChildNode(i); - if (pNode && (0 == mir_tstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) { + if (pNode && (0 == mir_wstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) { TNameValue Item = parse_setting_node(pNode); - if (0 == mir_tstrcmpi(g_sFromID.c_str(), Item.first.c_str())) { + if (0 == mir_wstrcmpi(g_sFromID.c_str(), Item.first.c_str())) { sFromID = Item.second; } - else if (0 == mir_tstrcmpi(g_sToID.c_str(), Item.first.c_str())) { + else if (0 == mir_wstrcmpi(g_sToID.c_str(), Item.first.c_str())) { sToID = Item.second; } } @@ -518,9 +518,9 @@ bool get_contact_state(const IXMLNode::TXMLNodePtr& pXmlContact, CContactState& size_t cChild = m_pXmlQuotes->GetChildCount(); for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = m_pXmlQuotes->GetChildNode(i); - if (pNode && (0 == mir_tstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) { + if (pNode && (0 == mir_wstrcmpi(g_pszXmlSetting, pNode->GetName().c_str()))) { TNameValue Item = parse_setting_node(pNode); - if (0 == mir_tstrcmpi(Item.first.c_str(), sXMLNodeName.c_str())) { + if (0 == mir_wstrcmpi(Item.first.c_str(), sXMLNodeName.c_str())) { sValue = Item.second; break; } @@ -568,7 +568,7 @@ bool import_contact(const IXMLNode::TXMLNodePtr& pXmlContact, CImportContext& im for (size_t i = 0; i < cChild && bResult; ++i) { IXMLNode::TXMLNodePtr pNode = pXmlContact->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(g_pszXmlModule, sName.c_str())) + if (0 == mir_wstrcmpi(g_pszXmlModule, sName.c_str())) bResult &= handle_module(cst.m_hContact, pNode); } @@ -590,7 +590,7 @@ size_t import_contacts(const IXMLNode::TXMLNodePtr& pXmlContacts, CImportContext for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pXmlContacts->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(g_pszXmlContact, sName.c_str())) + if (0 == mir_wstrcmpi(g_pszXmlContact, sName.c_str())) if (true == import_contact(pNode, impctx)) ++cContacts; } @@ -606,7 +606,7 @@ size_t handle_contacts_node(const IXMLNode::TXMLNodePtr& pXmlRoot, CImportContex for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pXmlRoot->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(g_pszXmlContacts, sName.c_str())) + if (0 == mir_wstrcmpi(g_pszXmlContacts, sName.c_str())) cContacts += import_contacts(pNode, impctx); else cContacts += handle_contacts_node(pNode, impctx); diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index 263df84fac..7c058e6830 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -26,15 +26,15 @@ bool parse_quote(const IXMLNode::TXMLNodePtr& pTop, CQuotesProviderBase::CQuote& for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pTop->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(L"symbol", sName.c_str())) { + if (0 == mir_wstrcmpi(L"symbol", sName.c_str())) { sSymbol = pNode->GetText(); if (true == sSymbol.empty()) return false; } - else if (0 == mir_tstrcmpi(L"description", sName.c_str())) { + else if (0 == mir_wstrcmpi(L"description", sName.c_str())) { sDescription = pNode->GetText(); } - else if (0 == mir_tstrcmpi(L"id", sName.c_str())) { + else if (0 == mir_wstrcmpi(L"id", sName.c_str())) { sID = pNode->GetText(); if (true == sID.empty()) return false; @@ -55,17 +55,17 @@ bool parse_section(const IXMLNode::TXMLNodePtr& pTop, CQuotesProviderBase::CQuot for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pTop->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(L"section", sName.c_str())) { + if (0 == mir_wstrcmpi(L"section", sName.c_str())) { CQuotesProviderBase::CQuoteSection qs1; if (true == parse_section(pNode, qs1)) aSections.push_back(qs1); } - else if (0 == mir_tstrcmpi(L"quote", sName.c_str())) { + else if (0 == mir_wstrcmpi(L"quote", sName.c_str())) { CQuotesProviderBase::CQuote q; if (true == parse_quote(pNode, q)) aQuotes.push_back(q); } - else if (0 == mir_tstrcmpi(L"name", sName.c_str())) { + else if (0 == mir_wstrcmpi(L"name", sName.c_str())) { sSectionName = pNode->GetText(); if (true == sSectionName.empty()) return false; @@ -83,7 +83,7 @@ IXMLNode::TXMLNodePtr find_provider(const IXMLNode::TXMLNodePtr& pRoot) for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pRoot->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(L"Provider", sName.c_str())) { + if (0 == mir_wstrcmpi(L"Provider", sName.c_str())) { pProvider = pNode; break; } @@ -111,16 +111,16 @@ CQuotesProviderBase::CXMLFileInfo parse_ini_file(const tstring& rsXMLFile, bool& for (size_t i = 0; i < cChild; ++i) { IXMLNode::TXMLNodePtr pNode = pProvider->GetChildNode(i); tstring sName = pNode->GetName(); - if (0 == mir_tstrcmpi(L"section", sName.c_str())) { + if (0 == mir_wstrcmpi(L"section", sName.c_str())) { CQuotesProviderBase::CQuoteSection qs; if (true == parse_section(pNode, qs)) aSections.push_back(qs); } - else if (0 == mir_tstrcmpi(L"Name", sName.c_str())) + else if (0 == mir_wstrcmpi(L"Name", sName.c_str())) res.m_pi.m_sName = pNode->GetText(); - else if (0 == mir_tstrcmpi(L"ref", sName.c_str())) + else if (0 == mir_wstrcmpi(L"ref", sName.c_str())) res.m_pi.m_sURL = pNode->GetText(); - else if (0 == mir_tstrcmpi(L"url", sName.c_str())) + else if (0 == mir_wstrcmpi(L"url", sName.c_str())) res.m_sURL = pNode->GetText(); } } @@ -508,11 +508,11 @@ bool show_popup(const IQuotesProvider* pProvider, CQuotesProviderVisitorFormater visitor(hContact, 's', 0); pProvider->Accept(visitor); const tstring& sTitle = visitor.GetResult(); - mir_tstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME); + mir_wstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME); { - ptrT ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact)); + ptrW ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact)); tstring sText = format_rate(pProvider, hContact, tstring(ss)); - mir_tstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE); + mir_wstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE); } if (CPopupSettings::colourDefault == ps.GetColourMode()) { diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp index 8404c2b479..8ecfcf1498 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp @@ -114,13 +114,13 @@ void parse_row(const THTMLNodePtr& pRow, TEconomicRates& raRates) if (pCol) { tstring sColID = pCol->GetAttribute(L"id"); if (false == sColID.empty()) { - if (0 == mir_tstrcmpi(sColID.c_str(), L"stock")) { + if (0 == mir_wstrcmpi(sColID.c_str(), L"stock")) { ri.m_sName = pCol->GetText(); if (false == ri.m_sName.empty()) { ++cColsHandled; } } - else if (0 == mir_tstrcmpi(sSidID.str().c_str(), sColID.c_str())) { + else if (0 == mir_wstrcmpi(sSidID.str().c_str(), sColID.c_str())) { tstring sRate = pCol->GetText(); if ((false == sRate.empty()) && (true == string2double(sRate.c_str(), ri.m_dCurRate))) { ri.m_dPrevRate = ri.m_dCurRate; diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index 9403611d54..9f02e9e2b2 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -106,9 +106,9 @@ namespace for (int i = 0; i < cItems; ++i) { const CQuotesProviderBase::CQuote* pQuote = get_quote_ptr_from_lb_index(hwndList, i); if ((nullptr != pQuote) - && ((0 == mir_tstrcmpi(rsQuoteID.c_str(), pQuote->GetID().c_str())) - || (0 == mir_tstrcmpi(rsQuoteID.c_str(), pQuote->GetName().c_str())) - || (0 == mir_tstrcmpi(rsQuoteID.c_str(), pQuote->GetSymbol().c_str())))) { + && ((0 == mir_wstrcmpi(rsQuoteID.c_str(), pQuote->GetID().c_str())) + || (0 == mir_wstrcmpi(rsQuoteID.c_str(), pQuote->GetName().c_str())) + || (0 == mir_wstrcmpi(rsQuoteID.c_str(), pQuote->GetSymbol().c_str())))) { return i; } } @@ -218,7 +218,7 @@ namespace [&apCurrent, pProvider](const CQuotesProviderBase::CQuote& quote) { if (apCurrent.end() == std::find_if(apCurrent.begin(), apCurrent.end(), - ["e](const CQuotesProviderBase::CQuote* pQuote) { return 0 == mir_tstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) { + ["e](const CQuotesProviderBase::CQuote* pQuote) { return 0 == mir_wstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) { pProvider->WatchForQuote(quote, false); } }); @@ -228,7 +228,7 @@ namespace { if (aTemp.end() == std::find_if(aTemp.begin(), aTemp.end(), - [pQuote](const CQuotesProviderBase::CQuote& quote) { return 0 == mir_tstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) { + [pQuote](const CQuotesProviderBase::CQuote& quote) { return 0 == mir_wstrcmpi(pQuote->GetID().c_str(), quote.GetID().c_str()); })) { pProvider->WatchForQuote(*pQuote, true); } diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index 95e15ca85b..a124a1b002 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -21,8 +21,8 @@ inline bool is_rate_watched(MCONTACT hContact, { tstring sFrom = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_ID); tstring sTo = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_ID); - return ((0 == mir_tstrcmpi(from.GetID().c_str(), sFrom.c_str())) - && (0 == mir_tstrcmpi(to.GetID().c_str(), sTo.c_str()))); + return ((0 == mir_wstrcmpi(from.GetID().c_str(), sFrom.c_str())) + && (0 == mir_wstrcmpi(to.GetID().c_str(), sTo.c_str()))); } bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri, @@ -102,7 +102,7 @@ typedef IHTMLNode::THTMLNodePtr THTMLNodePtr; bool parse_html_node(const THTMLNodePtr& pNode, double& rdRate) { tstring sID = pNode->GetAttribute(L"id"); - if ((false == sID.empty()) && (0 == mir_tstrcmpi(sID.c_str(), L"currency_converter_result"))) { + if ((false == sID.empty()) && (0 == mir_wstrcmpi(sID.c_str(), L"currency_converter_result"))) { size_t cChild = pNode->GetChildCount(); // assert(1 == cChild); if (cChild > 0) { @@ -218,8 +218,8 @@ TWatchedRates g_aWatchedRates; bool is_equal_rate(const CQuotesProviderGoogle::CRateInfo& riL, const CQuotesProviderGoogle::CRateInfo& riR) { - return ((0 == mir_tstrcmpi(riL.m_from.GetID().c_str(), riR.m_from.GetID().c_str())) - && ((0 == mir_tstrcmpi(riL.m_to.GetID().c_str(), riR.m_to.GetID().c_str())))); + return ((0 == mir_wstrcmpi(riL.m_from.GetID().c_str(), riR.m_from.GetID().c_str())) + && ((0 == mir_wstrcmpi(riL.m_to.GetID().c_str(), riR.m_to.GetID().c_str())))); } INT_PTR CALLBACK GoogleOptDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) @@ -419,8 +419,8 @@ namespace { tstring sFrom = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_ID); tstring sTo = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_ID); - return ((0 == mir_tstrcmpi(rsFromID.c_str(), sFrom.c_str())) - && (0 == mir_tstrcmpi(rsToID.c_str(), sTo.c_str()))); + return ((0 == mir_wstrcmpi(rsFromID.c_str(), sFrom.c_str())) + && (0 == mir_wstrcmpi(rsToID.c_str(), sTo.c_str()))); } } diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index cfcda85e76..4b18bdf7ac 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -80,7 +80,7 @@ tstring get_var_value(const tstring& rsHTML, LPCTSTR pszVarName, size_t cVarName tstring get_company_id(const tstring& rsHTML) { static LPCTSTR pszVarName = L"setCompanyId("; - static size_t cVarNameLength = mir_tstrlen(pszVarName); + static size_t cVarNameLength = mir_wstrlen(pszVarName); tstring sResult; tstring::size_type n = rsHTML.find(pszVarName); @@ -100,7 +100,7 @@ tstring get_company_id(const tstring& rsHTML) tstring get_company_name(const tstring& rsHTML) { static LPCTSTR pszVarName = L"var _companyName = "; - static size_t cVarNameLength = mir_tstrlen(pszVarName); + static size_t cVarNameLength = mir_wstrlen(pszVarName); tstring s = get_var_value(rsHTML, pszVarName, cVarNameLength); if (s.size() > 0 && '\'' == s[0]) @@ -151,7 +151,7 @@ bool get_inline_data(const IHTMLNode::THTMLNodePtr& pNode, CGoogleInfo& rInfo) IHTMLNode::THTMLNodePtr pName = pChild->GetChildPtr(0); tstring sName = pName->GetText(); - if (0 == mir_tstrcmpi(sName.c_str(), L"Open")) { + if (0 == mir_wstrcmpi(sName.c_str(), L"Open")) { IHTMLNode::THTMLNodePtr pValue = pChild->GetChildPtr(1); tstring sValue = pValue->GetText(); if (true == get_double_value(sValue, rInfo.m_dOpenValue)) { diff --git a/plugins/Quotes/src/QuotesProviders.cpp b/plugins/Quotes/src/QuotesProviders.cpp index 0a3e220d7f..3a316df3d3 100644 --- a/plugins/Quotes/src/QuotesProviders.cpp +++ b/plugins/Quotes/src/QuotesProviders.cpp @@ -82,7 +82,7 @@ CQuotesProviders::TQuotesProviderPtr CQuotesProviders::FindProvider(const tstrin for (TQuotesProviders::const_iterator i = m_apProviders.begin(); i != m_apProviders.end(); ++i) { const TQuotesProviderPtr& pProvider = *i; const IQuotesProvider::CProviderInfo& rInfo = pProvider->GetInfo(); - if (0 == ::mir_tstrcmpi(rsName.c_str(), rInfo.m_sName.c_str())) { + if (0 == ::mir_wstrcmpi(rsName.c_str(), rInfo.m_sName.c_str())) { pResult = pProvider; break; } diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index 5e8b0f0751..c11f038809 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -977,7 +977,7 @@ tstring GenerateLogFileName(const tstring &rsLogFilePattern, const tstring &rsQu if (tstring::npos != n) { tstring s = rsQuoteSymbol; std::for_each(s.begin(), s.end(), boost::bind(replace_invalid_char, _1, '_')); - sPath.replace(n, mir_tstrlen(g_pszVariableQuoteName), s.c_str()); + sPath.replace(n, mir_wstrlen(g_pszVariableQuoteName), s.c_str()); } } diff --git a/plugins/Quotes/src/XMLEngineMI.cpp b/plugins/Quotes/src/XMLEngineMI.cpp index 5f694a31d0..ed63a63784 100644 --- a/plugins/Quotes/src/XMLEngineMI.cpp +++ b/plugins/Quotes/src/XMLEngineMI.cpp @@ -77,7 +77,7 @@ public: virtual void Write(tostream& o)const { - ptrT ss(xmlToString(m_hXML, NULL)); + ptrW ss(xmlToString(m_hXML, NULL)); if (ss != NULL) o << (char*)T2Utf(ss); } @@ -109,7 +109,7 @@ IXMLNode::TXMLNodePtr CXMLEngineMI::LoadFile(const tstring& rsFileName)const pBuffer[cBytes] = '\0'; int nLen = (int)cBytes; - ptrT ss(mir_utf8decodeT(pBuffer)); + ptrW ss(mir_utf8decodeW(pBuffer)); if (ss) { HXML h = xmlParseString(ss, &nLen, NULL); if (h) diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h index d4c5d2ffc1..fe0bde6b88 100644 --- a/plugins/Quotes/src/stdafx.h +++ b/plugins/Quotes/src/stdafx.h @@ -53,7 +53,7 @@ typedef boost::posix_time::wtime_facet ttime_facet; inline std::string quotes_t2a(const wchar_t* t) { std::string s; - char* p = mir_t2a(t); + char* p = mir_u2a(t); if (p) { s = p; mir_free(p); @@ -64,7 +64,7 @@ inline std::string quotes_t2a(const wchar_t* t) inline tstring quotes_a2t(const char* s) { tstring t; - wchar_t* p = mir_a2t(s); + wchar_t* p = mir_a2u(s); if (p) { t = p; mir_free(p); -- cgit v1.2.3