summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_advsearch.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-16 18:08:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-16 18:08:37 +0000
commit253783569bef2320d04fe1d310709c64c64fd3a1 (patch)
tree55181ccfc8d93cd78aa8ded73bc7ab289e6ec8b9 /protocols/IcqOscarJ/src/icq_advsearch.cpp
parentb3783bb50a312fa59d302aeede929377c18a6ec1 (diff)
- custom list of time zones removed;
- adaptation of ICQ for new Time API; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8140 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_advsearch.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_advsearch.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/protocols/IcqOscarJ/src/icq_advsearch.cpp b/protocols/IcqOscarJ/src/icq_advsearch.cpp
index d3bd412980..15eee0bc3d 100644
--- a/protocols/IcqOscarJ/src/icq_advsearch.cpp
+++ b/protocols/IcqOscarJ/src/icq_advsearch.cpp
@@ -31,32 +31,25 @@
static void InitComboBox(HWND hwndCombo, const FieldNamesItem *names)
{
- int iItem;
- int i;
+ SendMessage(hwndCombo, CB_SETCURSEL, ComboBoxAddStringUtf(hwndCombo, NULL, 0), 0);
- iItem = ComboBoxAddStringUtf(hwndCombo, NULL, 0);
- SendMessage(hwndCombo, CB_SETCURSEL, iItem, 0);
-
- if (names){
- for (i = 0; names[i].text; i++) {
- iItem = ComboBoxAddStringUtf(hwndCombo, names[i].text, names[i].code);
- }
+ if (names) {
+ for (int i = 0; names[i].text; i++)
+ ComboBoxAddStringUtf(hwndCombo, names[i].text, names[i].code);
}
else {
int ctryCount;
struct CountryListEntry *countries;
CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&ctryCount, (LPARAM)&countries);
- for (i = 0; i < ctryCount; i++) {
+ for (int i = 0; i < ctryCount; i++)
if (countries[i].id != 0xFFFF && countries[i].id != 0)
- iItem = ComboBoxAddStringUtf(hwndCombo, LPGEN(countries[i].szName), countries[i].id);
- }
+ ComboBoxAddStringUtf(hwndCombo, LPGEN(countries[i].szName), countries[i].id);
}
}
INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch(message)
- {
+ switch(message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
InitComboBox(GetDlgItem(hwndDlg, IDC_GENDER), genderField);
@@ -68,10 +61,7 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
InitComboBox(GetDlgItem(hwndDlg, IDC_COUNTRY), countryField);
InitComboBox(GetDlgItem(hwndDlg, IDC_INTERESTSCAT), interestsField);
InitComboBox(GetDlgItem(hwndDlg, IDC_PASTCAT), pastField);
-
return TRUE;
- default:
- break;
}
return FALSE;
@@ -122,10 +112,10 @@ static PBYTE createAdvancedSearchStructureTLV(HWND hwndDlg, int *length)
BYTE b = (BYTE)getCurItemData(hwndDlg, IDC_GENDER);
switch (b) {
- case 'F': b = 1; break;
- case 'M': b = 2; break;
- default: b = 0;
- };
+ case 'F': b = 1; break;
+ case 'M': b = 2; break;
+ default: b = 0;
+ }
ppackLETLVByte(&buf, &buflen, b, TLV_GENDER, 0);
ppackLETLVByte(&buf, &buflen, (BYTE)getCurItemData(hwndDlg, IDC_MARITALSTATUS), TLV_MARITAL, 0);
ppackLETLVWord(&buf, &buflen, (WORD)getCurItemData(hwndDlg, IDC_LANGUAGE), TLV_LANGUAGE, 0);