diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
commit | 2f261839b60692e33d0e160344d0d636d49c90ba (patch) | |
tree | 187921722698b681d29df3f6e60fb18394a5e9d5 /plugins/FavContacts | |
parent | 2e931a0b2780587d85f3902468c935f5adba70c8 (diff) |
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FavContacts')
-rw-r--r-- | plugins/FavContacts/src/contact_cache.cpp | 14 | ||||
-rw-r--r-- | plugins/FavContacts/src/favlist.h | 12 | ||||
-rw-r--r-- | plugins/FavContacts/src/menu.cpp | 16 | ||||
-rw-r--r-- | plugins/FavContacts/src/services.cpp | 40 |
4 files changed, 41 insertions, 41 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index fb837cdd09..632875cf57 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -116,9 +116,9 @@ float CContactCache::getWeight(int rate) static bool AppendInfo(wchar_t *buf, int size, MCONTACT hContact, int info)
{
- ptrT str(Contact_GetInfo(info, hContact));
+ ptrW str(Contact_GetInfo(info, hContact));
if (str != NULL) {
- mir_tstrncpy(buf, str, size);
+ mir_wstrncpy(buf, str, size);
return true;
}
@@ -140,7 +140,7 @@ void CContactCache::TContactInfo::LoadInfo() for (int i = 0; i < _countof(items); ++i)
if (AppendInfo(p, _countof(info) - (p - info), hContact, items[i]))
- p += mir_tstrlen(p) + 1;
+ p += mir_wstrlen(p) + 1;
*p = 0;
@@ -155,8 +155,8 @@ wchar_t *nb_stristr(wchar_t *str, wchar_t *substr) wchar_t *str_up = NEWWSTR_ALLOCA(str);
wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
- CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up));
- CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up));
+ CharUpperBuff(str_up, (DWORD)mir_wstrlen(str_up));
+ CharUpperBuff(substr_up, (DWORD)mir_wstrlen(substr_up));
wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
@@ -177,7 +177,7 @@ bool CContactCache::filter(int rate, wchar_t *str) for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) {
if (kbdLayoutActive == kbdLayouts[iLayout])
- mir_tstrcpy(buf, str);
+ mir_wstrcpy(buf, str);
else {
int i;
for (i = 0; str[i]; ++i) {
@@ -188,7 +188,7 @@ bool CContactCache::filter(int rate, wchar_t *str) buf[i] = 0;
}
- for (wchar_t *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1)
+ for (wchar_t *p = m_cache[rate]->info; p && *p; p = p + mir_wstrlen(p) + 1)
if (nb_stristr(p, buf))
return true;
}
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index 91245327d7..3cbb4a8285 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -17,13 +17,13 @@ public: bManual(_bManual),
fRate(_fRate)
{
- name = mir_tstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
+ name = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
if (g_Options.bUseGroups) {
if ((group = db_get_tsa(hContact, "CList", "Group")) == NULL)
- group = mir_tstrdup(TranslateT("<no group>"));
+ group = mir_wstrdup(TranslateT("<no group>"));
}
- else group = mir_tstrdup(TranslateT("Favorite Contacts"));
+ else group = mir_wstrdup(TranslateT("Favorite Contacts"));
status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
}
@@ -56,8 +56,8 @@ public: }
int res = 0;
- if (res = mir_tstrcmp(p1->group, p2->group)) return res;
- if (res = mir_tstrcmp(p1->name, p2->name)) return res;
+ if (res = mir_wstrcmp(p1->group, p2->group)) return res;
+ if (res = mir_wstrcmp(p1->name, p2->name)) return res;
return 0;
}
};
@@ -85,7 +85,7 @@ private: TContactInfo *info = new TContactInfo(hContact, bManual);
insert(info);
wchar_t *group = info->getGroup();
- if (prevGroup && mir_tstrcmp(prevGroup, group))
+ if (prevGroup && mir_wstrcmp(prevGroup, group))
++nGroups;
prevGroup = group;
return 1;
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 15c2f3189e..64568587c2 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -47,7 +47,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options) SelectObject(hdc, g_Options.hfntName);
SIZE sz;
- GetTextExtentPoint32(hdc, name, (int)mir_tstrlen(name), &sz);
+ GetTextExtentPoint32(hdc, name, (int)mir_wstrlen(name), &sz);
lpmis->itemHeight = sz.cy + 8;
lpmis->itemWidth = sz.cx + 10;
SelectObject(hdc, hfntSave);
@@ -81,7 +81,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) if (!options->bSysColors)
SelectObject(hdc, g_Options.hfntSecond);
- GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &sz);
+ GetTextExtentPoint32(hdc, title, (int)mir_wstrlen(title), &sz);
textWidth = sz.cx;
lpmis->itemHeight += sz.cy + 3;
@@ -92,7 +92,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (!options->bSysColors) SelectObject(hdc, g_Options.hfntName);
- GetTextExtentPoint32(hdc, name, (int)mir_tstrlen(name), &sz);
+ GetTextExtentPoint32(hdc, name, (int)mir_wstrlen(name), &sz);
textWidth = max(textWidth, sz.cx);
SelectObject(hdc, hfntSave);
@@ -309,7 +309,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) DrawText(hdcTemp, name, -1, &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_TOP | DT_LEFT);
SIZE sz;
- GetTextExtentPoint32(hdcTemp, name, (int)mir_tstrlen(name), &sz);
+ GetTextExtentPoint32(hdcTemp, name, (int)mir_wstrlen(name), &sz);
lpdis->rcItem.top += sz.cy + 3;
}
@@ -390,13 +390,13 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, RemoveMenu((HMENU)lParam, 1, MF_BYPOSITION);
if (LOWORD(wParam) == VK_BACK) {
- if (size_t l = mir_tstrlen(g_filter))
+ if (size_t l = mir_wstrlen(g_filter))
g_filter[l - 1] = 0;
}
else if (iswalnum(LOWORD(wParam))) {
- if (mir_tstrlen(g_filter) < _countof(g_filter) - 1) {
+ if (mir_wstrlen(g_filter) < _countof(g_filter) - 1) {
wchar_t s[] = { LOWORD(wParam), 0 };
- mir_tstrcat(g_filter, s);
+ mir_wstrcat(g_filter, s);
}
}
{
@@ -465,7 +465,7 @@ int ShowMenu(bool centered) mis.CtlID = 0;
mis.CtlType = ODT_MENU;
- if (!prevGroup || mir_tstrcmp(prevGroup, favList[i]->getGroup())) {
+ if (!prevGroup || mir_wstrcmp(prevGroup, favList[i]->getGroup())) {
if (prevGroup && g_Options.bUseColumns) {
szMenu.cx += szColumn.cx;
szMenu.cy = max(szMenu.cy, szColumn.cy);
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 556e0ebbaa..00a053b996 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -128,27 +128,27 @@ int ProcessReloadFonts(WPARAM, LPARAM) LOGFONT lf = { 0 };
FontIDT fontid = { sizeof(fontid) };
- mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts"));
- mir_tstrcpy(fontid.name, LPGENW("Contact name"));
+ mir_wstrcpy(fontid.group, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(fontid.name, LPGENW("Contact name"));
g_Options.clLine1 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntName = CreateFontIndirect(&lf);
- mir_tstrcpy(fontid.name, LPGENW("Second line"));
+ mir_wstrcpy(fontid.name, LPGENW("Second line"));
g_Options.clLine2 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntSecond = CreateFontIndirect(&lf);
- mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
+ mir_wstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
- mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
+ mir_wstrcpy(fontid.name, LPGENW("Selected second line (color)"));
g_Options.clLine2Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
ColourIDT colourid = { sizeof(colourid) };
- mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts"));
- mir_tstrcpy(colourid.name, LPGENW("Background"));
+ mir_wstrcpy(colourid.group, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(colourid.name, LPGENW("Background"));
g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
- mir_tstrcpy(colourid.name, LPGENW("Selected background"));
+ mir_wstrcpy(colourid.name, LPGENW("Selected background"));
g_Options.clBackSel = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
return 0;
@@ -171,38 +171,38 @@ int ProcessModulesLoaded(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////
FontIDT fontid = { sizeof(fontid) };
- mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(fontid.group, LPGENW("Favorite Contacts"));
mir_strcpy(fontid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts"));
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.size = -11;
- mir_tstrcpy(fontid.deffontsettings.szFace, L"MS Shell Dlg");
+ mir_wstrcpy(fontid.deffontsettings.szFace, L"MS Shell Dlg");
fontid.deffontsettings.style = 0;
- mir_tstrcpy(fontid.backgroundName, LPGENW("Background"));
+ mir_wstrcpy(fontid.backgroundName, LPGENW("Background"));
- mir_tstrcpy(fontid.name, LPGENW("Contact name"));
+ mir_wstrcpy(fontid.name, LPGENW("Contact name"));
mir_strcpy(fontid.prefix, "fntName");
fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.name, LPGENW("Second line"));
+ mir_wstrcpy(fontid.name, LPGENW("Second line"));
mir_strcpy(fontid.prefix, "fntSecond");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU));
fontid.deffontsettings.style = 0;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.backgroundName, LPGENW("Selected background"));
+ mir_wstrcpy(fontid.backgroundName, LPGENW("Selected background"));
- mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
+ mir_wstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
mir_strcpy(fontid.prefix, "fntNameSel");
fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
+ mir_wstrcpy(fontid.name, LPGENW("Selected second line (color)"));
mir_strcpy(fontid.prefix, "fntSecondSel");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT));
fontid.deffontsettings.style = 0;
@@ -211,15 +211,15 @@ int ProcessModulesLoaded(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////
ColourIDT colourid = { sizeof(colourid) };
- mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts"));
+ mir_wstrcpy(colourid.group, LPGENW("Favorite Contacts"));
mir_strcpy(colourid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(colourid.name, LPGENW("Background"));
+ mir_wstrcpy(colourid.name, LPGENW("Background"));
mir_strcpy(colourid.setting, "BackColour");
colourid.defcolour = GetSysColor(COLOR_MENU);
ColourRegisterT(&colourid);
- mir_tstrcpy(colourid.name, LPGENW("Selected background"));
+ mir_wstrcpy(colourid.name, LPGENW("Selected background"));
mir_strcpy(colourid.setting, "SelectedColour");
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
|