summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/ctrl_edit.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/UserInfoEx/src/ctrl_edit.cpp
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/UserInfoEx/src/ctrl_edit.cpp')
-rw-r--r--plugins/UserInfoEx/src/ctrl_edit.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp
index 3fb01c479b..1da43c143c 100644
--- a/plugins/UserInfoEx/src/ctrl_edit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_edit.cpp
@@ -179,15 +179,15 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
dbv.type = _dbType;
switch (_dbType) {
case DBVT_BYTE:
- dbv.bVal = (BYTE)wcstol(val, NULL, 10);
+ dbv.bVal = (BYTE)wcstol(val, nullptr, 10);
break;
case DBVT_WORD:
- dbv.wVal = (WORD)wcstol(val, NULL, 10);
+ dbv.wVal = (WORD)wcstol(val, nullptr, 10);
break;
case DBVT_DWORD:
- dbv.dVal = (DWORD)wcstol(val, NULL, 10);
+ dbv.dVal = (DWORD)wcstol(val, nullptr, 10);
break;
case DBVT_WCHAR:
@@ -209,7 +209,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
// save new value
MIR_FREE(_pszValue);
_pszValue = val;
- val = NULL;
+ val = nullptr;
}
}
}
@@ -223,7 +223,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
OnInfoChanged(hContact, pszProto);
}
- InvalidateRect(_hwnd, NULL, TRUE);
+ InvalidateRect(_hwnd, nullptr, TRUE);
}
}
@@ -253,7 +253,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg)
need_free = 1;
}
- if (szText != NULL) {
+ if (szText != nullptr) {
GetWindowText(_hwnd, szText, cch + 1);
_Flags.B.hasChanged = mir_wstrcmp(_pszValue, szText) != 0;
if (need_free)
@@ -261,7 +261,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg)
}
else _Flags.B.hasChanged = false;
}
- InvalidateRect(_hwnd, NULL, TRUE);
+ InvalidateRect(_hwnd, nullptr, TRUE);
if (_Flags.B.hasChanged)
SendMessage(GetParent(GetParent(_hwnd)), PSM_CHANGED, 0, 0);
@@ -295,12 +295,12 @@ void CEditCtrl::OpenUrl()
LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk)
{
- if (lnk == NULL)
+ if (lnk == nullptr)
return FALSE;
switch (lnk->msg) {
case WM_SETCURSOR:
- SetCursor(LoadCursor(NULL, IDC_HAND));
+ SetCursor(LoadCursor(nullptr, IDC_HAND));
SetWindowLongPtr(GetParent(_hwnd), DWLP_MSGRESULT, TRUE);
return TRUE;
@@ -323,7 +323,7 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk)
need_free = 1;
}
if (tr.lpstrText && (SendMessage(_hwnd, EM_GETTEXTRANGE, NULL, (LPARAM)&tr) > 0)) {
- if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
+ if (wcschr(tr.lpstrText, '@') != nullptr && wcschr(tr.lpstrText, ':') == nullptr && wcschr(tr.lpstrText, '/') == nullptr) {
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)));
}