From e650f45f5028eb533b02f2d05fc85e275ba3cbf2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Apr 2016 19:09:59 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@16720 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcidents.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 1ae357f3b7..b716ddfa59 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -105,7 +105,7 @@ int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, Clc int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts) { - int index = 0, i; + int index = 0; int nowVisible = 1; ClcGroup *group = &dat->list; @@ -114,22 +114,23 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro for (;;) { if (group->scanIndex == group->cl.count) { - ClcGroup *tgroup; group = group->parent; if (group == NULL) break; nowVisible = 1; - for (tgroup = group; tgroup; tgroup = tgroup->parent) { + for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent) if (!tgroup->expanded) { nowVisible = 0; break; } - } + group->scanIndex++; continue; } - if (nowVisible) index++; + + if (nowVisible) + index++; ClcContact *c = group->cl.items[group->scanIndex]; if ((IsHContactGroup(dwItem) && c->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == c->groupId) || @@ -144,8 +145,7 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro else { RECT clRect; GetClientRect(hwnd, &clRect); - if (posy >= dat->yScroll + clRect.bottom) *isVisible = 0; - else *isVisible = 1; + *isVisible = (posy < dat->yScroll + clRect.bottom); } } } @@ -156,7 +156,7 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro } if (!isIgnoreSubcontacts && IsHContactContact(dwItem) && c->type == CLCIT_CONTACT && c->SubAllocated > 0) { - for (i = 0; i < c->SubAllocated; i++) { + for (int i = 0; i < c->SubAllocated; i++) { if (c->subcontacts[i].hContact == dwItem) { if (contact) *contact = &c->subcontacts[i]; if (subgroup) *subgroup = group; -- cgit v1.2.3