From 33fa85c712ad498aebb5c518fb7973fb40fcdf46 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 27 May 2016 19:13:19 +0000 Subject: - unneeded variable removed from clist_modern cache; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@16876 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcutils.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'plugins/Clist_modern/src/modern_clcutils.cpp') diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index a18420734d..6c0364836f 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -251,18 +251,16 @@ void cliBeginRenameSelection(HWND hwnd, ClcData *dat) if (dat->selection == -1 || (contact->type != CLCIT_CONTACT && contact->type != CLCIT_GROUP)) return; - int indent, subindent; - if (contact->type == CLCIT_CONTACT && contact->iSubNumber) - subindent = dat->subIndent; - else - subindent = 0; + int subindent = (contact->type == CLCIT_CONTACT && contact->iSubNumber) ? dat->subIndent : 0; RECT clRect; GetClientRect(hwnd, &clRect); - for (indent = 0; group->parent; indent++, group = group->parent); - int x = indent*dat->groupIndent + dat->iconXSpace - 2 + subindent; + + POINT pt; + pcli->pfnCalcEipPosition(dat, contact, group, &pt); + + int x = pt.x + subindent, y = pt.y; int w = clRect.right - x; - int y = cliGetRowTopY(dat, dat->selection) - dat->yScroll; int h = dat->getRowHeight(dat->selection); for (int i = 0; i <= FONTID_MODERN_MAX; i++) @@ -271,16 +269,15 @@ void cliBeginRenameSelection(HWND hwnd, ClcData *dat) RECT rectW; GetWindowRect(hwnd, &rectW); - - x = contact->pos_rename_rect.left + rectW.left; - y = contact->pos_label.top + rectW.top; - w = contact->pos_rename_rect.right - contact->pos_rename_rect.left; - h = contact->pos_label.bottom - contact->pos_label.top + 4; + x += rectW.left; + y += rectW.top; int a = 0; if (contact->type == CLCIT_GROUP) { - if (dat->row_align_group_mode == 1) a |= ES_CENTER; - else if (dat->row_align_group_mode == 2) a |= ES_RIGHT; + if (dat->row_align_group_mode == 1) + a |= ES_CENTER; + else if (dat->row_align_group_mode == 2) + a |= ES_RIGHT; } if (dat->text_rtl) a |= EN_ALIGN_RTL_EC; -- cgit v1.2.3