summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/ctrl_edit.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/UserInfoEx/src/ctrl_edit.cpp
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
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
Diffstat (limited to 'plugins/UserInfoEx/src/ctrl_edit.cpp')
-rw-r--r--plugins/UserInfoEx/src/ctrl_edit.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp
index 77a3904eb6..04bfdbe2b8 100644
--- a/plugins/UserInfoEx/src/ctrl_edit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_edit.cpp
@@ -108,7 +108,7 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged) {
DBVARIANT dbv;
- TCHAR szText[64];
+ wchar_t szText[64];
_Flags.B.hasCustom = _Flags.B.hasProto = _Flags.B.hasMeta = false;
_Flags.W |= DB::Setting::GetTStringCtrl(hContact, _pszModule, _pszModule, pszProto, _pszSetting, &dbv);
@@ -171,7 +171,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
DWORD cch = GetWindowTextLength(_hwnd);
if (cch > 0) {
- LPTSTR val = (LPTSTR)mir_alloc((cch + 1) * sizeof(TCHAR));
+ LPTSTR val = (LPTSTR)mir_alloc((cch + 1) * sizeof(wchar_t));
if (GetWindowText(_hwnd, val, cch + 1) > 0) {
DBVARIANT dbv;
@@ -179,15 +179,15 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
dbv.type = _dbType;
switch (_dbType) {
case DBVT_BYTE:
- dbv.bVal = (BYTE)_tcstol(val, NULL, 10);
+ dbv.bVal = (BYTE)wcstol(val, NULL, 10);
break;
case DBVT_WORD:
- dbv.wVal = (WORD)_tcstol(val, NULL, 10);
+ dbv.wVal = (WORD)wcstol(val, NULL, 10);
break;
case DBVT_DWORD:
- dbv.dVal = (DWORD)_tcstol(val, NULL, 10);
+ dbv.dVal = (DWORD)wcstol(val, NULL, 10);
break;
case DBVT_TCHAR:
@@ -245,11 +245,11 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg)
LPTSTR szText;
__try {
- szText = (LPTSTR)alloca((cch + 1) * sizeof(TCHAR));
+ szText = (LPTSTR)alloca((cch + 1) * sizeof(wchar_t));
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
- szText = (LPTSTR)mir_alloc((cch + 1) * sizeof(TCHAR));
+ szText = (LPTSTR)mir_alloc((cch + 1) * sizeof(wchar_t));
need_free = 1;
}
@@ -278,11 +278,11 @@ void CEditCtrl::OpenUrl()
BYTE need_free = 0;
__try {
- szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(TCHAR));
+ szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(wchar_t));
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
- szUrl = (LPTSTR)mir_alloc((8 + lenUrl) * sizeof(TCHAR));
+ szUrl = (LPTSTR)mir_alloc((8 + lenUrl) * sizeof(wchar_t));
need_free = 1;
}
@@ -315,17 +315,17 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk)
tr.chrg = lnk->chrg;
__try {
- tr.lpstrText = (LPTSTR)alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR));
+ tr.lpstrText = (LPTSTR)alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t));
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
- tr.lpstrText = (LPTSTR)mir_alloc((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR));
+ tr.lpstrText = (LPTSTR)mir_alloc((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t));
need_free = 1;
}
if (tr.lpstrText && (SendMessage(_hwnd, EM_GETTEXTRANGE, NULL, (LPARAM)&tr) > 0)) {
- if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) {
- memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(TCHAR));
- memcpy(tr.lpstrText, L"mailto:", (7 * sizeof(TCHAR)));
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
+ memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(wchar_t));
+ memcpy(tr.lpstrText, L"mailto:", (7 * sizeof(wchar_t)));
}
Utils_OpenUrlT(tr.lpstrText);