summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-19 19:09:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-19 19:09:59 +0000
commite650f45f5028eb533b02f2d05fc85e275ba3cbf2 (patch)
treeccca6be93afdda6694dadc0d28547e118110c3ef /plugins/Clist_modern
parent1a8c8c48ed38145781037cbe07f2d0c9c8c75d68 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16720 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clcidents.cpp16
1 files 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;