From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../src/ex_import/classExImContactBase.cpp | 4 +-- .../src/ex_import/classExImContactXML.cpp | 16 +++++----- .../UserInfoEx/src/ex_import/dlg_ExImModules.cpp | 2 +- .../src/ex_import/dlg_ExImOpenSaveFile.cpp | 6 ++-- .../UserInfoEx/src/ex_import/dlg_ExImProgress.cpp | 6 ++-- plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 10 +++---- plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp | 34 +++++++++++----------- plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp | 2 +- 8 files changed, 40 insertions(+), 40 deletions(-) (limited to 'plugins/UserInfoEx/src/ex_import') diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 27c15f4d03..96cd972f8c 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -477,8 +477,8 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact) if (dbv.type == DBVT_UTF8 && dbv.pszVal && !mir_strcmpi(dbv.pszVal,_pszNick)) { LPTSTR ptszNick = mir_utf8decodeT(_pszNick); LPTSTR ptszProto = mir_a2t(_pszProto); - int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENT("Question"), LPGENT("contact identification"), - LPGENT("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"), + int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENW("Question"), LPGENW("contact identification"), + LPGENW("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"), ptszNick, ptszProto); MIR_FREE(ptszNick); MIR_FREE(ptszProto); diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 39e31af3ab..e75750654f 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -603,9 +603,9 @@ int CExImContactXML::ImportContact() // ask to delete new incomplete contact if (_isNewContact && _hContact != NULL) { int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING, - LPGENT("Question"), - LPGENT("Importing a new contact was aborted!"), - LPGENT("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?")); + LPGENW("Question"), + LPGENW("Importing a new contact was aborted!"), + LPGENW("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?")); if (result == IDYES) { DB::Contact::Delete(_hContact); _hContact = INVALID_CONTACT_ID; @@ -742,9 +742,9 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact) LPTSTR ptszNick = mir_utf8decodeT(_pszNick); LPTSTR ptszMetaNick = mir_utf8decodeT(pMetaContact->_pszNick); int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING, - LPGENT("Question"), - LPGENT("Importing a new meta subcontact failed!"), - LPGENT("The newly created meta subcontact '%s'\ncould not be added to metacontact '%s'!\n\nDo you want to delete this contact?"), + LPGENW("Question"), + LPGENW("Importing a new meta subcontact failed!"), + LPGENW("The newly created meta subcontact '%s'\ncould not be added to metacontact '%s'!\n\nDo you want to delete this contact?"), ptszNick, ptszMetaNick); MIR_FREE(ptszNick); MIR_FREE(ptszMetaNick); @@ -821,7 +821,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule) else if (ImportSetting(pszModule, xKey->ToElement()) == ERROR_OK) { _pXmlFile->_numSettingsDone++; } - if (!_pXmlFile->_progress.UpdateSetting(LPGENT("Settings: %S"), pszModule)) + if (!_pXmlFile->_progress.UpdateSetting(LPGENW("Settings: %S"), pszModule)) return ERROR_ABORTED; } // import event @@ -835,7 +835,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule) _pXmlFile->_numEventsDuplicated++; break; } - if (!_pXmlFile->_progress.UpdateSetting(LPGENT("Events: %S"), pszModule)) + if (!_pXmlFile->_progress.UpdateSetting(LPGENW("Events: %S"), pszModule)) return ERROR_ABORTED; } } //*end for diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 5c43c0a7f1..10c51971b4 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -196,7 +196,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // Set the Window Title and description { LPCTSTR name = NULL; - TCHAR oldTitle[MAXDATASIZE], + wchar_t oldTitle[MAXDATASIZE], newTitle[MAXDATASIZE]; switch (pDat->ExImContact->Typ) { case EXIM_ALL: diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index e54f06003b..380e238788 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -106,7 +106,7 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara { if (uMsg == TB_ADDBUTTONS) { TBBUTTON *tbb = (TBBUTTON *)lParam; - TCHAR szBtnText[MAX_PATH]; + wchar_t szBtnText[MAX_PATH]; int iString; HWND hWndToolTip; @@ -280,7 +280,7 @@ int DlgExIm_OpenFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPS ofn.Flags |= OFN_PATHMUSTEXIST; if (!GetOpenFileNameA(&ofn)) { DWORD dwError = CommDlgExtendedError(); - if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The OpenFileDialog returned an error: %d!"), dwError); + if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The OpenFileDialog returned an error: %d!"), dwError); return -1; } SaveInitialDir(pszFile); @@ -307,7 +307,7 @@ int DlgExIm_SaveFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPS if (!GetSaveFileNameA(&ofn)) { DWORD dwError = CommDlgExtendedError(); - if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The SaveFileDialog returned an error: %d!"), dwError); + if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The SaveFileDialog returned an error: %d!"), dwError); return -1; } SaveInitialDir(pszFile); diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 524b3d2169..92981e12d7 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -187,7 +187,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...) if (_hDlg != NULL) { HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS2); if (pszFormat) { - TCHAR buf[MAX_PATH]; + wchar_t buf[MAX_PATH]; va_list vl; va_start(vl, pszFormat); @@ -213,8 +213,8 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...) if (_hDlg != NULL) { HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS); if (pszFormat) { - TCHAR buf[MAX_PATH]; - TCHAR tmp[MAX_PATH]; + wchar_t buf[MAX_PATH]; + wchar_t tmp[MAX_PATH]; va_list vl; va_start(vl, pszFormat); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index a45dc00c67..dfc1499a08 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -172,7 +172,7 @@ int SvcExImINI_Export(lpExImParam ExImContact, LPCSTR pszFileName) if (err != NULL) { MsgErr(NULL, - LPGENT("The ini-file \"%s\"\nfor saving contact information could not be opened."), + LPGENW("The ini-file \"%s\"\nfor saving contact information could not be opened."), pszFileName); return 1; } @@ -500,19 +500,19 @@ int SvcExImINI_Import(MCONTACT hContact, LPCSTR pszFileName) // the contact was not found in the file if (numContactsInFile > 0 && !numContactsAdded) { MsgErr(NULL, - LPGENT("None of the %d contacts, stored in the ini-file, match the selected contact!\nNothing will be imported"), + LPGENW("None of the %d contacts, stored in the ini-file, match the selected contact!\nNothing will be imported"), numContactsInFile); } // Import complete else{ - MsgBox(NULL, MB_ICON_INFO, LPGENT("Import complete"), LPGENT("Some basic statistics"), - LPGENT("Added %d of %d contacts stored in the ini-file."), + MsgBox(NULL, MB_ICON_INFO, LPGENW("Import complete"), LPGENW("Some basic statistics"), + LPGENW("Added %d of %d contacts stored in the ini-file."), numContactsAdded, numContactsInFile); } return 0; } MsgErr(NULL, - LPGENT("The ini-file \"%s\"\nfor reading contact information could not be opened."), + LPGENW("The ini-file \"%s\"\nfor reading contact information could not be opened."), pszFileName); return 1; } diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 35975b1abd..30f7151067 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -107,7 +107,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) FILE *xmlfile = fopen(pszFileName, "wt"); if (!xmlfile) { - MsgErr(NULL, LPGENT("Can't create xml file!\n%S"), pszFileName); + MsgErr(NULL, LPGENW("Can't create xml file!\n%S"), pszFileName); return 1; } @@ -183,7 +183,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) } // *end for #ifdef _DEBUG QueryPerformanceCounter(&t2); - MsgErr(NULL, LPGENT("Export took %f ms"), + MsgErr(NULL, LPGENW("Export took %f ms"), (long double)(t2.QuadPart - t1.QuadPart) / freq.QuadPart * 1000.); #endif }// *end other export mode @@ -255,7 +255,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) // update progressbar and abort if user clicked cancel LPTSTR pszNick = mir_utf8decodeT(xContact->Attribute("nick")); // user clicked abort button - if (_progress.UpdateContact(LPGENT("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) { + if (_progress.UpdateContact(LPGENW("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) { int result = vContact.LoadXmlElemnt(xContact); switch (result) { case ERROR_OK: @@ -271,7 +271,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) return ERROR_ABORTED; #ifdef _DEBUG default: - MsgErr(NULL, LPGENT("Importing %s caused error %d"), pszNick, result); + MsgErr(NULL, LPGENW("Importing %s caused error %d"), pszNick, result); break; #endif } @@ -282,7 +282,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) return ERROR_ABORTED; #ifdef _DEBUG default: - MsgErr(NULL, LPGENT("Loading contact %s from xml failed with error %d"), pszNick, result); + MsgErr(NULL, LPGENW("Loading contact %s from xml failed with error %d"), pszNick, result); break; #endif } @@ -300,7 +300,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent) return ERROR_ABORTED; #ifdef _DEBUG default: - MsgErr(NULL, LPGENT("Importing Owner caused error %d"), result); + MsgErr(NULL, LPGENW("Importing Owner caused error %d"), result); #endif } } @@ -345,19 +345,19 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) // load xml file TiXmlDocument doc; if (!doc.LoadFile(pszFileName)) { - MsgErr(NULL, LPGENT("Parser is unable to load XMLCard \"%s\"\nError: %d\nDescription: %s"), + MsgErr(NULL, LPGENW("Parser is unable to load XMLCard \"%s\"\nError: %d\nDescription: %s"), pszFileName, doc.ErrorId(), doc.ErrorDesc()); return 1; } // is xmlfile a XMLCard ? TiXmlElement *xmlCard = doc.FirstChildElement("XMLCard"); if (xmlCard == NULL) { - MsgErr(NULL, LPGENT("The selected file is no valid XMLCard")); + MsgErr(NULL, LPGENW("The selected file is no valid XMLCard")); return 1; } // check version if (mir_strcmp(xmlCard->Attribute("ver"), XMLCARD_VERSION)) { - MsgErr(NULL, LPGENT("The version of the XMLCard is not supported by UserInfoEx")); + MsgErr(NULL, LPGENW("The version of the XMLCard is not supported by UserInfoEx")); return 1; } @@ -374,12 +374,12 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) if (!ret) { MsgBox(NULL, MB_ICONINFORMATION, - LPGENT("Complete"), - LPGENT("Import complete"), - LPGENT("Owner contact successfully imported.")); + LPGENW("Complete"), + LPGENW("Import complete"), + LPGENW("Owner contact successfully imported.")); return 0; } else { - MsgErr(NULL, LPGENT("Selected XMLCard does not contain an owner contact!")); + MsgErr(NULL, LPGENW("Selected XMLCard does not contain an owner contact!")); return 1; } } @@ -406,12 +406,12 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) #ifdef _DEBUG QueryPerformanceCounter(&t2); - MsgErr(NULL, LPGENT("Import took %f ms"), + MsgErr(NULL, LPGENW("Import took %f ms"), (long double)(t2.QuadPart - t1.QuadPart) / freq.QuadPart * 1000.); #endif // show results - MsgBox(NULL, MB_ICONINFORMATION, LPGENT("Import complete"), LPGENT("Some basic statistics"), - LPGENT("added contacts: %u / %u\nadded settings: %u / %u\nadded events %u / %u\nduplicated events: %u"), + MsgBox(NULL, MB_ICONINFORMATION, LPGENW("Import complete"), LPGENW("Some basic statistics"), + LPGENW("added contacts: %u / %u\nadded settings: %u / %u\nadded events %u / %u\nduplicated events: %u"), _numContactsDone, _numContactsTodo, _numSettingsDone, _numSettingsTodo, _numEventsDone, _numEventsTodo, @@ -421,7 +421,7 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName) return 0; } catch(...) { - MsgErr(NULL, LPGENT("FATAL: An exception was thrown while importing contacts from xmlCard!")); + MsgErr(NULL, LPGENW("FATAL: An exception was thrown while importing contacts from xmlCard!")); return 1; } } diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index 157094e89e..864129010c 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -266,7 +266,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM) { ExImParam ExIm; INT_PTR hItem = 0, hRoot = 0, hParent = 0; - TCHAR tszGroup[120], tszItem[120]; + wchar_t tszGroup[120], tszItem[120]; memset(&tszGroup, 0, sizeof(tszGroup)); memset(&tszItem, 0, sizeof(tszItem)); memset(&ExIm, 0, sizeof(ExIm)); -- cgit v1.2.3