diff options
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);
|