From 35eaa182969aae253ccc7120af1bb966e38576d3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Apr 2016 19:09:41 +0000 Subject: clists code cleaning & optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@16668 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/clcutils.cpp | 10 +++++----- plugins/Clist_nicer/src/rowheight_funcs.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/Clist_nicer/src') diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 38bd82ebe9..303556b998 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -397,13 +397,12 @@ void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth) void RecalcScrollBar(HWND hwnd, struct ClcData *dat) { - SCROLLINFO si = { 0 }; - RECT clRect; - NMCLISTCONTROL nm; - RowHeight::calcRowHeights(dat, hwnd); + RECT clRect; GetClientRect(hwnd, &clRect); + + SCROLLINFO si = { 0 }; si.cbSize = sizeof(si); si.fMask = SIF_ALL; si.nMin = 0; @@ -426,12 +425,13 @@ void RecalcScrollBar(HWND hwnd, struct ClcData *dat) SetScrollInfo(hwnd, SB_VERT, &si, TRUE); } ScrollTo(hwnd, dat, dat->yScroll, 1); + + NMCLISTCONTROL nm; nm.hdr.code = CLN_LISTSIZECHANGE; nm.hdr.hwndFrom = hwnd; nm.hdr.idFrom = GetDlgCtrlID(hwnd); nm.pt.y = si.nMax; SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm); - //saveRecalcScrollBar(hwnd, dat); } void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState) diff --git a/plugins/Clist_nicer/src/rowheight_funcs.cpp b/plugins/Clist_nicer/src/rowheight_funcs.cpp index db18cbb6f7..79090e0b5c 100644 --- a/plugins/Clist_nicer/src/rowheight_funcs.cpp +++ b/plugins/Clist_nicer/src/rowheight_funcs.cpp @@ -126,7 +126,7 @@ int RowHeight::getMaxRowHeight(ClcData *dat, const HWND hwnd) return max_height; } -// Calc and store row height for all itens in the list +// Calc and store row height for all items in the list void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd) { int indent, subindex, line_num; @@ -159,7 +159,7 @@ void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd) // Calc row height getRowHeight(dat, Drawing, line_num, dwStyle); - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && /*!IsBadCodePtr((FARPROC)group->cl.items[group->scanIndex]->group) && */ (group->cl.items[group->scanIndex]->group->expanded & 0x0000ffff)) { + if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded & 0x0000ffff)) { group = group->cl.items[group->scanIndex]->group; indent++; group->scanIndex = 0; -- cgit v1.2.3