summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/ctrl_contact.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-07-10 16:59:27 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-07-10 16:59:27 +0000
commit2329457a8658926ceae20cf6ff883b24965e052f (patch)
tree66e7fa2652f1c6af7c742e52b2bba0f2fe4cbfb7 /plugins/UserInfoEx/src/ctrl_contact.cpp
parent18170fc2601f90dd8d1b39feae78fcafeb978332 (diff)
UserInfoEx:
-Cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@14525 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/ctrl_contact.cpp')
-rw-r--r--plugins/UserInfoEx/src/ctrl_contact.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp
index b8780f5b7b..372e830963 100644
--- a/plugins/UserInfoEx/src/ctrl_contact.cpp
+++ b/plugins/UserInfoEx/src/ctrl_contact.cpp
@@ -341,22 +341,25 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
noRecursion = 1;
{
TCHAR szText[MAXDATASIZE], *pText, *pArea, *pNumber;
- int isValid = 1;
+ bool isValid = true;
GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText));
- if (szText[0] != '+') isValid = 0;
+ if (szText[0] != '+')
+ isValid = false;
if (isValid) {
- int i, country = _tcstol(szText + 1, &pText, 10);
+ int country = _tcstol(szText + 1, &pText, 10);
if (pText - szText > 4)
- isValid = 0;
+ isValid = false;
else {
+ int i;
for (i = SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_GETCOUNT, 0, 0) - 1; i >= 0; i--) {
if (country == SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_GETITEMDATA, i, 0)) {
SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_SETCURSEL, i, 0);
break;
}
}
+ if (i < 0)
+ isValid = false;
}
- if (i < 0) isValid = 0;
}
if (isValid) {
pArea = pText + _tcscspn(pText, _T("0123456789"));