diff options
author | George Hazan <ghazan@miranda.im> | 2022-06-16 12:57:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-06-16 12:57:05 +0300 |
commit | 88998a47b210daa8006844f419f66a4e3dc23e20 (patch) | |
tree | c0a82377f92c70b0811f24ad2dcd75704f79f982 /plugins/UserInfoEx/src | |
parent | 751824c60f37e2c268fbd54deba8fccc30034436 (diff) |
fix for processing our own time zones
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r-- | plugins/UserInfoEx/src/ctrl_tzcombo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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);
|