summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-05-18 15:12:42 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-05-18 15:12:42 +0300
commit85449b314d11fedb6bb00c8d31b28577214a5053 (patch)
treefddb75a065dba1892444453397c061b385e1c1db /src
parent54694fba871917eac0ed422465064f0235b005d1 (diff)
code cleaning
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clc.cpp8
-rw-r--r--src/mir_app/src/clc.h2
-rw-r--r--src/mir_app/src/clcidents.cpp3
-rw-r--r--src/mir_app/src/clcitems.cpp2
-rw-r--r--src/mir_app/src/clcmsgs.cpp4
-rw-r--r--src/mir_app/src/clcutils.cpp4
6 files changed, 12 insertions, 11 deletions
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index c990c7a81b..12a8013834 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -503,7 +503,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
if (hSelItem) {
ClcGroup *selgroup;
if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
- dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(dat, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
}
@@ -703,7 +703,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
case CLCIT_CONTACT:
if (group == &dat->list)
return 0;
- dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(dat, group, -1);
goto LBL_MoveSelection;
}
}
@@ -895,9 +895,9 @@ LBL_MoveSelection:
Clist_SetGroupExpand(hwnd, dat, contact->group, -1);
if (dat->selection != -1) {
dat->selection =
- g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ g_clistApi.pfnGetRowsPriorTo(dat, selgroup, selgroup->cl.indexOf(selcontact));
if (dat->selection == -1)
- dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, contact->group, -1);
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(dat, contact->group, -1);
}
g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
UpdateWindow(hwnd);
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index 721f6b462b..3ca338e2f1 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -48,7 +48,7 @@ extern OBJLIST<MenuProto> g_menuProtos;
LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
/* clcidents.c */
-int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
+int fnGetRowsPriorTo(ClcData *dat, ClcGroup *subgroup, int contactIndex);
int fnGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
ClcContact* fnFindItem(uint32_t dwItem, ClcContact *contact);
diff --git a/src/mir_app/src/clcidents.cpp b/src/mir_app/src/clcidents.cpp
index 6bcc6eeebe..bb9345fc6a 100644
--- a/src/mir_app/src/clcidents.cpp
+++ b/src/mir_app/src/clcidents.cpp
@@ -42,10 +42,11 @@ contains routines to convert between them.
2->1: GetRowByIndex()
*/
-int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex)
+int fnGetRowsPriorTo(ClcData *dat, ClcGroup *subgroup, int contactIndex)
{
int count = 0;
+ auto *group = &dat->list;
group->scanIndex = 0;
for (;;) {
if (group->scanIndex == group->cl.getCount()) {
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp
index df60a7ee3d..9678c5e87e 100644
--- a/src/mir_app/src/clcitems.cpp
+++ b/src/mir_app/src/clcitems.cpp
@@ -574,7 +574,7 @@ void fnSortCLC(HWND hwnd, ClcData *dat, int useInsertionSort)
if (hSelItem) {
ClcGroup *selgroup;
if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
- dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(dat, selgroup, selgroup->cl.indexOf(selcontact));
}
g_clistApi.pfnRecalcScrollBar(hwnd, dat);
diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp
index 638dab4493..762ca67596 100644
--- a/src/mir_app/src/clcmsgs.cpp
+++ b/src/mir_app/src/clcmsgs.cpp
@@ -101,7 +101,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
Clist_SetGroupExpand(hwnd, dat, tgroup, 1);
- Clist_EnsureVisible(hwnd, dat, g_clistApi.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact)), 0);
+ Clist_EnsureVisible(hwnd, dat, g_clistApi.pfnGetRowsPriorTo(dat, group, group->cl.indexOf(contact)), 0);
break;
case CLM_EXPAND:
@@ -316,7 +316,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
Clist_SetGroupExpand(hwnd, dat, tgroup, 1);
- dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
+ dat->selection = g_clistApi.pfnGetRowsPriorTo(dat, group, group->cl.indexOf(contact));
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
break;
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp
index 3000d7132c..b493dec69c 100644
--- a/src/mir_app/src/clcutils.cpp
+++ b/src/mir_app/src/clcutils.cpp
@@ -301,7 +301,7 @@ MIR_APP_DLL(void) Clist_SetGroupExpand(HWND hwnd, ClcData *dat, ClcGroup *group,
g_clistApi.pfnInvalidateRect(hwnd, nullptr, FALSE);
int contentCount = g_clistApi.pfnGetGroupContentsCount(group, 1);
- int groupy = g_clistApi.pfnGetRowsPriorTo(&dat->list, group, -1);
+ int groupy = g_clistApi.pfnGetRowsPriorTo(dat, group, -1);
if (dat->selection > groupy && dat->selection < groupy + contentCount)
dat->selection = groupy;
@@ -377,7 +377,7 @@ int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
Clist_SetGroupExpand(hwnd, dat, group, 1);
- return g_clistApi.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ return g_clistApi.pfnGetRowsPriorTo(dat, contactGroup, contactScanIndex);
}
if (cc->type == CLCIT_GROUP) {
if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || cc->group->bExpanded) {