From b3efd156b2ded1777ee2b4522acba1fa2d666ca7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 May 2016 13:54:36 +0000 Subject: group processing code standardization git-svn-id: http://svn.miranda-ng.org/main/trunk@16869 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/clcitems.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins/Clist_nicer/src/clcitems.cpp') diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 5bcbdfd9ad..a73a0827e2 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -199,15 +199,18 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) group->scanIndex = 0; for (;;) { if (group->scanIndex == group->cl.count) { - group = group->parent; - if (group == NULL) + if ((group = group->parent) == NULL) break; + group->scanIndex++; + continue; } - else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - if (group->cl.items[group->scanIndex]->group->cl.count == 0) - group = pcli->pfnRemoveItemFromGroup(hwnd, group, group->cl.items[group->scanIndex], 0); + + ClcContact *cc = group->cl.items[group->scanIndex]; + if (cc->type == CLCIT_GROUP) { + if (cc->group->cl.count == 0) + group = pcli->pfnRemoveItemFromGroup(hwnd, group, cc, 0); else { - group = group->cl.items[group->scanIndex]->group; + group = cc->group; group->scanIndex = 0; } continue; -- cgit v1.2.3