From 878d72910cccf4f84c7cb45bb4c11134920f3166 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Aug 2015 11:49:54 +0000 Subject: - naming conflict; - warning fixes; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14988 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WhenWasIt/src/dlg_handlers.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'plugins/WhenWasIt/src') diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 1083287cc2..932ba2a47f 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -398,18 +398,16 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case WM_INITDIALOG: TranslateDialogDefault(hWnd); SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam); - { - MCONTACT hContact = lParam; - WindowList_Add(hAddBirthdayWndsList, hWnd, hContact); - Utils_RestoreWindowPositionNoSize(hWnd, hContact, ModuleName, "BirthdayWnd"); - } + + hContact = lParam; + WindowList_Add(hAddBirthdayWndsList, hWnd, hContact); + Utils_RestoreWindowPositionNoSize(hWnd, hContact, ModuleName, "BirthdayWnd"); + SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(hAddBirthdayContact, 1)); - { - for (int i = 0; i < cSaveModule; i++) - SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSaveModule[i])); - SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_SETCURSEL, commonData.cDefaultModule, 0); - } + for (int i = 0; i < cSaveModule; i++) + SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSaveModule[i])); + SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_SETCURSEL, commonData.cDefaultModule, 0); break; case WM_SHOWWINDOW: @@ -487,9 +485,9 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: - SYSTEMTIME st; - MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA); + hContact = (MCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA); HWND hDate = GetDlgItem(hWnd, IDC_DATE); + SYSTEMTIME st; if (DateTime_GetSystemtime(hDate, &st) == GDT_VALID) { int mode = SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_GETCURSEL, 0, 0); //SAVE modes in date_utils.h are synced SaveBirthday(hContact, st.wYear, st.wMonth, st.wDay, mode); @@ -580,6 +578,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, currentDay = today->tm_mday + 1; currentMonth = today->tm_mon + 1; } + else currentMonth = currentDay = 0; int year, month, day; int module = GetContactDOB(hContact, year, month, day); -- cgit v1.2.3