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/WebView/src/main.cpp | 2 +- plugins/WebView/src/webview.cpp | 12 +++++------ plugins/WebView/src/webview_alerts.cpp | 30 ++++++++++++++-------------- plugins/WebView/src/webview_datawnd.cpp | 6 +++--- plugins/WebView/src/webview_opts.cpp | 8 ++++---- plugins/WebView/src/webview_services.cpp | 34 ++++++++++++++++---------------- 6 files changed, 46 insertions(+), 46 deletions(-) (limited to 'plugins/WebView/src') diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 7bc2acf7a3..a47782293c 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -221,7 +221,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("Countdown", CountdownMenuCommand); mi.flags |= CMIF_KEEPUNTRANSLATED; wchar_t countername[100]; - mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0)); + mir_snwprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0)); mi.position = 600090099; mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL)); mi.name.w = countername; diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 3abb94ffb6..39cbf6dfc7 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -64,7 +64,7 @@ void ChangeMenuItemCountdown() HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL)); wchar_t countername[100]; - mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0)); + mir_snwprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0)); Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED); } @@ -173,7 +173,7 @@ int Doubleclick(WPARAM wParam, LPARAM) int action = db_get_b(hContact, MODULENAME, DBLE_WIN_KEY, 1); if (action == 0) { - ptrT url(db_get_tsa(hContact, MODULENAME, "URL")); + ptrW url(db_get_tsa(hContact, MODULENAME, "URL")); Utils_OpenUrlT(url); db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE); @@ -241,10 +241,10 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb cfFM.dwEffects = bold | italic | underline; if (!db_get_ts(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) { - mir_tstrcpy(cfFM.szFaceName, dbv.ptszVal); + mir_wstrcpy(cfFM.szFaceName, dbv.ptszVal); db_free(&dbv); } - else mir_tstrcpy(cfFM.szFaceName, Def_font_face); + else mir_wstrcpy(cfFM.szFaceName, Def_font_face); HDC hDC = GetDC(hWindow); cfFM.yHeight = (BYTE)MulDiv(abs(g_lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (db_get_b(NULL, MODULENAME, FONT_SIZE_KEY, 14)); @@ -327,7 +327,7 @@ void FontSettings(void) g_lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; g_lf.lfQuality = DEFAULT_QUALITY; g_lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN; - mir_tstrcpy(g_lf.lfFaceName, Def_font_face); + mir_wstrcpy(g_lf.lfFaceName, Def_font_face); } /*****************************************************************************/ @@ -443,7 +443,7 @@ int OnTopMenuCommand(WPARAM, LPARAM, MCONTACT singlecontact) INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM) { MCONTACT hContact = wParam; - ptrT url(db_get_tsa(hContact, MODULENAME, "URL")); + ptrW url(db_get_tsa(hContact, MODULENAME, "URL")); if (url) Utils_OpenUrlT(url); diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 65987f66f9..eee757a5e8 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -30,7 +30,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND: case WM_CONTEXTMENU: MCONTACT hContact = PUGetContact(hWnd); - ptrT url( db_get_tsa(hContact, MODULENAME, URL_KEY)); + ptrW url( db_get_tsa(hContact, MODULENAME, URL_KEY)); if (message == WM_COMMAND) { // left click if(hContact != NULL) { @@ -116,19 +116,19 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if( ((HANDLE)wParam) != NULL) { DBVARIANT dbv; db_get_ts(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv); - mir_tstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName)); + mir_wstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName)); db_free(&dbv); } - else mir_tstrcpy(ppd.lptzContactName, MODULENAMEW); + else mir_wstrcpy(ppd.lptzContactName, MODULENAMEW); ppd.lchContact = wParam; ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)); wchar_t *displaytext = (wchar_t*)lParam; - if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE)) - mir_sntprintf(ppd.lptzText, displaytext); - else if (mir_tstrlen(displaytext) < MAX_SECONDLINE) - mir_sntprintf(ppd.lptzText, displaytext); + if ((mir_wstrlen(displaytext) == MAX_SECONDLINE) || (mir_wstrlen(displaytext) > MAX_SECONDLINE)) + mir_snwprintf(ppd.lptzText, displaytext); + else if (mir_wstrlen(displaytext) < MAX_SECONDLINE) + mir_snwprintf(ppd.lptzText, displaytext); if ( db_get_b(NULL, MODULENAME, POP_USECUSTCLRS_KEY, 0)) { ppd.colorBack = db_get_dw(NULL, MODULENAME, POP_BG_CLR_KEY, Def_color_bg); @@ -188,11 +188,11 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) wchar_t *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0); if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) { - mir_sntprintf(newdisplaytext, L"%s\n%s", ptszContactName, displaytext); + mir_snwprintf(newdisplaytext, L"%s\n%s", ptszContactName, displaytext); PUShowMessageT(newdisplaytext, SM_WARNING); } else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) { - mir_sntprintf(newdisplaytext, L"%s: %s", ptszContactName, TranslateTS(displaytext)); + mir_snwprintf(newdisplaytext, L"%s: %s", ptszContactName, TranslateTS(displaytext)); CallService("OSD/Announce", (WPARAM)newdisplaytext, 0); } else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) { @@ -357,7 +357,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn // if ((!notpresent)) { if (alertIndex == 0) { // popup - mir_sntprintf(displaystring, L"%s \"%S\" %s.", Translate("The string"), alertstring, Translate("has been found on the web page")); + mir_snwprintf(displaystring, L"%s \"%S\" %s.", Translate("The string"), alertstring, Translate("has been found on the web page")); WAlertPopup(hContact, displaystring); // contactlist name// @@ -397,7 +397,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn } } else if (alertIndex == 3) { - mir_sntprintf(displaystring, L"%s \"%s\" %s.", TranslateT("The string"), alertstring, TranslateT("has been found on the web page")); + mir_snwprintf(displaystring, L"%s \"%s\" %s.", TranslateT("The string"), alertstring, TranslateT("has been found on the web page")); WAlertOSD(hContact, displaystring); // contactlist name// @@ -426,9 +426,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\"); + mir_snwprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\"); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt"); + mir_snwprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt"); // file exists? if ( _waccess(newcachepath, 0) != -1) { if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL) @@ -638,9 +638,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\"); + mir_snwprintf(cachedirectorypath, L"%s%S%S", cachepath, MODULENAME, "cache\\"); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt"); + mir_snwprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt"); // file exists? if ( _waccess(newcachepath, 0) != -1) { if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL) diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index acd228eb6d..a45f188ac1 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -129,10 +129,10 @@ static MCONTACT FindContactByUrl(HWND hwndDlg) GetWindowText(hwndDlg, titlebartxt, _countof(titlebartxt)); for (MCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { - ptrT db1( db_get_tsa(hContact, MODULENAME, URL_KEY)); - ptrT db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW db1( db_get_tsa(hContact, MODULENAME, URL_KEY)); + ptrW db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); - if (!mir_tstrcmp(urltext, db1) && !mir_tstrcmp(titlebartxt, db2)) { + if (!mir_wstrcmp(urltext, db1) && !mir_wstrcmp(titlebartxt, db2)) { contactcount++; if (contactcount > 1) { MessageBox(NULL, TranslateT("ERROR: You have two or more Webview contacts with the same URL and contact name."), MODULENAMEW, MB_OK); diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index a833fed559..69d878fbd6 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -53,9 +53,9 @@ wchar_t* FixButtonText(wchar_t *url, size_t len) int pos = (stringafter - buttontext); int posbefore = (stringafter - buttontext) - 1; int posafter = (stringafter - buttontext) + 1; - strdelt(stringafter, 1); + strdelw(stringafter, 1); wcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE); - mir_sntprintf(newbuttontext, L"%s!!%s", stringbefore, stringafter); + mir_snwprintf(newbuttontext, L"%s!!%s", stringbefore, stringafter); posafter = 0; posbefore = 0; @@ -206,9 +206,9 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) TextColour = TextClr; } ppd.lchContact = NULL; - mir_tstrcpy(ppd.lptzContactName, MODULENAMEW); + mir_wstrcpy(ppd.lptzContactName, MODULENAMEW); ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)); - mir_tstrcpy(ppd.lptzText, TranslateT("This is a preview popup.")); + mir_wstrcpy(ppd.lptzText, TranslateT("This is a preview popup.")); ppd.colorBack = BGColour; ppd.colorText = TextColour; ppd.PluginWindowProc = NULL; diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 718c57fdbf..b3d8a70504 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -46,12 +46,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) // A contact is renamed if (!strcmp(cws->szSetting, "MyHandle")) { - ptrT oldName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW oldName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); if (oldName == NULL) return 0; wchar_t nick[100]; - ptrT oldnick( db_get_tsa(hContact, "CList", "MyHandle")); + ptrW oldnick( db_get_tsa(hContact, "CList", "MyHandle")); if (oldnick != NULL) wcsncpy_s(nick, oldnick, _TRUNCATE); else @@ -70,7 +70,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) srand((unsigned)time(NULL)); wchar_t ranStr[7]; _itow((int)10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); - mir_tstrcat(nick, ranStr); + mir_wstrcat(nick, ranStr); } if ( wcschr(nick, '(') == 0) { @@ -85,19 +85,19 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) wchar_t *cacheend = wcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); + mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); wchar_t newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; - mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName); - mir_sntprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick); + mir_snwprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName); + mir_snwprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick); // file exists? if ( _waccess(newcachepath, 0) != -1) { FILE *pcachefile = _wfopen(newcachepath, L"r"); if (pcachefile != NULL) { fclose(pcachefile); - if (mir_tstrcmp(newcachepath, renamedcachepath)) { + if (mir_wstrcmp(newcachepath, renamedcachepath)) { MoveFile(newcachepath, renamedcachepath); db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, renamedcachepath); } @@ -115,7 +115,7 @@ int SiteDeleted(WPARAM wParam, LPARAM) if (mir_strcmp(GetContactProto(hContact), MODULENAME)) return 0; - ptrT contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); // TEST GET NAME FOR CACHE wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50]; @@ -124,9 +124,9 @@ int SiteDeleted(WPARAM wParam, LPARAM) cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); + mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName); + mir_snwprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName); // file exists? if ( _waccess(newcachepath, 0) != -1) { FILE *pcachefile = _wfopen(newcachepath, L"r"); @@ -149,7 +149,7 @@ INT_PTR OpenCacheDir(WPARAM, LPARAM) cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend); + mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend); if( _waccess(cachedirectorypath, 0) != 0) WErrorPopup((UINT_PTR)"ERROR", TranslateT("Cache folder does not exist.")); @@ -167,7 +167,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM) return 0; } - ptrT url( db_get_tsa(wParam, MODULENAME, "URL")); + ptrW url( db_get_tsa(wParam, MODULENAME, "URL")); if (url == NULL) return 0; @@ -319,12 +319,12 @@ INT_PTR BasicSearch(WPARAM, LPARAM lParam) static wchar_t buf[300]; if (lParam) - mir_tstrncpy(buf, (const wchar_t*) lParam, 256); + mir_wstrncpy(buf, (const wchar_t*) lParam, 256); if (searchId != -1) return 0; // only one search at a time - mir_tstrncpy(sID, (wchar_t*)lParam, _countof(sID)); + mir_wstrncpy(sID, (wchar_t*)lParam, _countof(sID)); searchId = 1; // create a thread for the ID search @@ -355,7 +355,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) // check ID to see if the contact already exist in the database if (db_get_ts(hContact, MODULENAME, "URL", &dbv)) continue; - if (!mir_tstrcmpi(psr->nick.w, dbv.ptszVal)) { + if (!mir_wstrcmpi(psr->nick.w, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list @@ -406,7 +406,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) for (MCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) { if (!db_get_ts(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { - if (!mir_tstrcmpi(Newnick, dbv.ptszVal)) { + if (!mir_wstrcmpi(Newnick, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list @@ -427,7 +427,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) wchar_t ranStr[10]; _itow((int) 10000 *rand() / (RAND_MAX + 1.0), ranStr, 10); - mir_tstrcat(Newnick, ranStr); + mir_wstrcat(Newnick, ranStr); } //end convert -- cgit v1.2.3