diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-10 14:19:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-10 14:19:03 +0300 |
commit | ab48946296156b94919b0ee31d2ac6404a3cc4c2 (patch) | |
tree | a3c58f4cb3daeb4ea6d7e5e3bdc81a5fde8a91f5 /plugins/Clist_modern/src/modern_clc.cpp | |
parent | 97a16a6e09df80ffa3429e23a0174bd8daaa29a1 (diff) |
ClistModern: fix for a very old bug when selection jumps to the first line during group's expansion/contraction
Diffstat (limited to 'plugins/Clist_modern/src/modern_clc.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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);
}
|