summaryrefslogtreecommitdiff
path: root/src/modules/clist
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/clist')
-rw-r--r--src/modules/clist/clc.h1
-rw-r--r--src/modules/clist/clcutils.cpp26
-rw-r--r--src/modules/clist/clistcore.cpp1
3 files changed, 16 insertions, 12 deletions
diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h
index 9bd95c3c9d..acb5279007 100644
--- a/src/modules/clist/clc.h
+++ b/src/modules/clist/clc.h
@@ -95,6 +95,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour);
void fnLoadClcOptions(HWND hwnd, struct ClcData *dat);
void fnRecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat);
void fnSetGroupChildCheckboxes(ClcGroup *group, int checked);
+void fnSetContactCheckboxes(ClcContact *cc, int checked);
void fnInvalidateItem(HWND hwnd, struct ClcData *dat, int iItem);
int fnGetRowBottomY(struct ClcData *dat, int item);
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index 470936f9e4..92ed6de693 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -818,22 +818,24 @@ void fnRecalculateGroupCheckboxes(HWND, struct ClcData *dat)
}
}
+void fnSetContactCheckboxes(ClcContact *cc, int checked)
+{
+ if (checked)
+ cc->flags |= CONTACTF_CHECKED;
+ else
+ cc->flags &= ~CONTACTF_CHECKED;
+}
+
void fnSetGroupChildCheckboxes(ClcGroup *group, int checked)
{
for (int i=0; i < group->cl.count; i++) {
- if (group->cl.items[i]->type == CLCIT_GROUP) {
- cli.pfnSetGroupChildCheckboxes(group->cl.items[i]->group, checked);
- if (checked)
- group->cl.items[i]->flags |= CONTACTF_CHECKED;
- else
- group->cl.items[i]->flags &= ~CONTACTF_CHECKED;
- }
- else if (group->cl.items[i]->type == CLCIT_CONTACT) {
- if (checked)
- group->cl.items[i]->flags |= CONTACTF_CHECKED;
- else
- group->cl.items[i]->flags &= ~CONTACTF_CHECKED;
+ ClcContact *cc = group->cl.items[i];
+ if (cc->type == CLCIT_GROUP) {
+ cli.pfnSetGroupChildCheckboxes(cc->group, checked);
+ cli.pfnSetContactCheckboxes(cc, checked);
}
+ else if (cc->type == CLCIT_CONTACT)
+ cli.pfnSetContactCheckboxes(cc, checked);
}
}
diff --git a/src/modules/clist/clistcore.cpp b/src/modules/clist/clistcore.cpp
index 89f6770927..156f1149f7 100644
--- a/src/modules/clist/clistcore.cpp
+++ b/src/modules/clist/clistcore.cpp
@@ -127,6 +127,7 @@ static INT_PTR srvRetrieveInterface(WPARAM, LPARAM)
cli.pfnLoadClcOptions = fnLoadClcOptions;
cli.pfnRecalculateGroupCheckboxes = fnRecalculateGroupCheckboxes;
cli.pfnSetGroupChildCheckboxes = fnSetGroupChildCheckboxes;
+ cli.pfnSetContactCheckboxes = fnSetContactCheckboxes;
cli.pfnInvalidateItem = fnInvalidateItem;
cli.pfnGetRowBottomY = fnGetRowBottomY;
cli.pfnGetRowHeight = fnGetRowHeight;