From 6bb048378e2b73c908f4512d9a925e736bd44fda Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 May 2021 13:26:56 +0300 Subject: CCtrlCombo::GetCurData = suitable helper for combo boxes --- plugins/XSoundNotify/src/options.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'plugins/XSoundNotify/src') diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index c720c8ecb4..bab5567543 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -32,9 +32,9 @@ class COptionsDlg : public CDlgBase XSN_Data* ObtainData() { - LPARAM hContact = comboUser.GetItemData(comboUser.GetCurSel()); + LPARAM hContact = comboUser.GetCurData(); if (hContact == -1) { - PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetItemData(comboAcc.GetCurSel()); + PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetCurData(); XSN_Data *p = XSN_Users.find((XSN_Data *)&pa->szModuleName); if (p == nullptr) XSN_Users.insert(p = new XSN_Data(pa->szModuleName, chkIgnore.GetState())); @@ -114,8 +114,7 @@ public: chkIgnore.SetState(false); label.SetText(TranslateT("Not set")); - int cursel = comboAcc.GetCurSel(); - PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetItemData(cursel); + PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetCurData(); comboUser.AddString(TranslateT("All contacts"), -1); for (auto &hContact : Contacts(pa->szModuleName)) { @@ -130,9 +129,9 @@ public: btnChoose.Enable(); chkIgnore.Enable(); - LPARAM hContact = comboUser.GetItemData(comboUser.GetCurSel()); + LPARAM hContact = comboUser.GetCurData(); if (hContact == -1) { - PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetItemData(comboAcc.GetCurSel()); + PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetCurData(); ptrW wszText(g_plugin.getWStringA(pa->szModuleName)); if (wszText) { btnTest.Enable(); @@ -226,9 +225,9 @@ public: chkIgnore.SetState(false); label.SetText(TranslateT("Not set")); - LPARAM hContact = comboUser.GetItemData(comboUser.GetCurSel()); + LPARAM hContact = comboUser.GetCurData(); if (hContact == -1) { - PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetItemData(comboAcc.GetCurSel()); + PROTOACCOUNT *pa = (PROTOACCOUNT *)comboAcc.GetCurData(); XSN_Data *p = XSN_Users.find((XSN_Data *)&pa->szModuleName); if (p != nullptr) { XSN_Users.remove(p); -- cgit v1.2.3