summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-05-11 13:26:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-05-11 13:26:56 +0300
commit6bb048378e2b73c908f4512d9a925e736bd44fda (patch)
tree59fa9ffce6e00d82c3b6254b7e5d2cdcde3bdb89 /src/mir_app
parent383409527e474e83078178f5e80975b64fb5ffcf (diff)
CCtrlCombo::GetCurData = suitable helper for combo boxes
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/MDatabaseCommonCrypt.cpp2
-rw-r--r--src/mir_app/src/addcontact.cpp6
-rw-r--r--src/mir_app/src/lpopts.cpp6
-rw-r--r--src/mir_app/src/options.cpp5
-rw-r--r--src/mir_app/src/profilemanager.cpp9
5 files changed, 11 insertions, 17 deletions
diff --git a/src/mir_app/src/MDatabaseCommonCrypt.cpp b/src/mir_app/src/MDatabaseCommonCrypt.cpp
index 1e0258a318..baa0ade9f5 100644
--- a/src/mir_app/src/MDatabaseCommonCrypt.cpp
+++ b/src/mir_app/src/MDatabaseCommonCrypt.cpp
@@ -36,7 +36,7 @@ class CSelectCryptoDialog : public CDlgBase
CRYPTO_PROVIDER *getCurrent()
{
- return (CRYPTO_PROVIDER*)m_combo.GetItemData(m_combo.GetCurSel());
+ return (CRYPTO_PROVIDER*)m_combo.GetCurData();
}
bool OnInitDialog() override
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp
index 3146974a23..c4520d37ba 100644
--- a/src/mir_app/src/addcontact.cpp
+++ b/src/mir_app/src/addcontact.cpp
@@ -119,9 +119,9 @@ public:
if (mir_wstrlen(szHandle))
db_set_ws(hContact, "CList", "MyHandle", szHandle);
- int item = m_group.GetCurSel();
- if (item > 0)
- Clist_ContactChangeGroup(hContact, m_group.GetItemData(item));
+ MGROUP iGroup = m_group.GetCurData();
+ if (iGroup >= 0)
+ Clist_ContactChangeGroup(hContact, iGroup);
Contact_PutOnList(hContact);
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp
index 7439de1e08..a397dad825 100644
--- a/src/mir_app/src/lpopts.cpp
+++ b/src/mir_app/src/lpopts.cpp
@@ -197,8 +197,7 @@ void CLangpackDlg::DisplayPackInfo(const LANGPACK_INFO *pack)
void CLangpackDlg::Languages_OnChange(CCtrlBase*)
{
- int idx = m_languages.GetCurSel();
- LANGPACK_INFO *pack = (LANGPACK_INFO*)m_languages.GetItemData(idx);
+ LANGPACK_INFO *pack = (LANGPACK_INFO*)m_languages.GetCurData();
DisplayPackInfo(pack);
if (!(pack->flags & LPF_ENABLED))
SendMessage(GetParent(GetHwnd()), PSM_CHANGED, 0, 0);
@@ -208,8 +207,7 @@ void CLangpackDlg::Languages_OnChange(CCtrlBase*)
void CLangpackDlg::Reload_OnClick(CCtrlBase*)
{
m_reload.Enable(FALSE);
- int idx = m_languages.GetCurSel();
- LANGPACK_INFO *pack = (LANGPACK_INFO*)m_languages.GetItemData(idx);
+ LANGPACK_INFO *pack = (LANGPACK_INFO*)m_languages.GetCurData();
ReloadLangpack(pack->tszFullPath);
DisplayPackInfo(pack);
m_reload.Enable(TRUE);
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 3e34f00092..be2c96b67b 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -527,9 +527,8 @@ class COptionsDlg : public CDlgBase
wcsncpy_s(m_szFilterString, pos, _TRUNCATE);
}
else {
- int sel = m_keywordFilter.GetCurSel();
- if (sel != -1) {
- HINSTANCE hinst = (HINSTANCE)m_keywordFilter.GetItemData(sel);
+ HINSTANCE hinst = (HINSTANCE)m_keywordFilter.GetCurData();
+ if (hinst != INVALID_HANDLE_VALUE) {
wchar_t szFileName[300];
GetModuleFileName(hinst, szFileName, _countof(szFileName));
wchar_t *pos = wcsrchr(szFileName, '\\');
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp
index 5c4453cb45..e87673aee7 100644
--- a/src/mir_app/src/profilemanager.cpp
+++ b/src/mir_app/src/profilemanager.cpp
@@ -648,12 +648,9 @@ public:
void OnDestroy()
{
if (m_chkSmEnabled.GetState()) {
- LRESULT curSel = m_servicePlugs.GetCurSel();
- if (curSel != -1) {
- int idx = m_servicePlugs.GetItemData(curSel);
- if (idx != -1)
- plugin_service = servicePlugins[idx];
- }
+ int idx = m_servicePlugs.GetCurData();
+ if (idx != -1)
+ plugin_service = servicePlugins[idx];
}
DestroyIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0));