From ab48946296156b94919b0ee31d2ac6404a3cc4c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 10 Mar 2018 14:19:03 +0300 Subject: ClistModern: fix for a very old bug when selection jumps to the first line during group's expansion/contraction --- plugins/Clist_modern/src/modern_clc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/Clist_modern/src/modern_clc.cpp') diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 2b80d741cd..e7bef1a7d9 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -523,7 +523,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM ClcContact *contact2; ClcGroup *group2; if (Clist_FindItem(hwnd, dat, contact->hContact, &contact2, &group2, nullptr)) { - int i = cliGetRowsPriorTo(&dat->list, group2, GetContactIndex(group2, contact2)); + int i = cliGetRowsPriorTo(&dat->list, group2, group2->cl.indexOf(contact2)); pcli->pfnEnsureVisible(hwnd, dat, i + contact->iSubAllocated, 0); } } @@ -617,7 +617,7 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR ClcContact *contact; ClcGroup *group; if (Clist_FindItem(hwnd, dat, hitcontact->hContact, &contact, &group, nullptr)) { - i = cliGetRowsPriorTo(&dat->list, group, GetContactIndex(group, contact)); + i = cliGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)); pcli->pfnEnsureVisible(hwnd, dat, i + hitcontact->iSubAllocated, 0); } } @@ -739,7 +739,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lP dat->selection = cliGetRowByIndex(dat, dat->selection, &selcontact, &selgroup); pcli->pfnSetGroupExpand(hwnd, dat, contact->group, -1); if (dat->selection != -1) { - dat->selection = cliGetRowsPriorTo(&dat->list, selgroup, GetContactIndex(selgroup, selcontact)); + dat->selection = cliGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact)); if (dat->selection == -1) dat->selection = cliGetRowsPriorTo(&dat->list, contact->group, -1); } -- cgit v1.2.3