From 88998a47b210daa8006844f419f66a4e3dc23e20 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 16 Jun 2022 12:57:05 +0300 Subject: fix for processing our own time zones --- plugins/UserInfoEx/src/ctrl_tzcombo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/UserInfoEx/src') diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp index f28c7812a0..dd6c8d8d49 100644 --- a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp +++ b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp @@ -75,12 +75,12 @@ CTzCombo::CTzCombo(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting) **/ int CTzCombo::Find(LPTIME_ZONE_INFORMATION pTimeZone) const { - int nItemIndex; int nItemCount = ComboBox_GetCount(_hwnd); - for (nItemIndex = 0; nItemIndex < nItemCount; nItemIndex++) { - if (pTimeZone == TimeZone_GetInfo((HANDLE)ComboBox_GetItemData(_hwnd, nItemIndex))) - return nItemIndex; + for (int i = 0; i < nItemCount; i++) { + HANDLE pItemData = (HANDLE)ComboBox_GetItemData(_hwnd, i); + if (pItemData && pTimeZone == TimeZone_GetInfo(pItemData)) + return i; } return CB_ERR; } @@ -110,7 +110,7 @@ BOOL CTzCombo::OnInfoChanged(MCONTACT hContact, LPCSTR) { if (!_Flags.B.hasChanged) { LPTIME_ZONE_INFORMATION pTimeZone; - pTimeZone = getTziByContact(hContact); + pTimeZone = getTziByContact(hContact, TZF_PLF_CB); ComboBox_SetCurSel(_hwnd, Find(pTimeZone)); _curSel = ComboBox_GetCurSel(_hwnd); SendMessage(GetParent(_hwnd), WM_TIMER, 0, 0); -- cgit v1.2.3