From 0c060267ccea726d5c2c2fd1e45d1f16965fb01e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 16 Aug 2015 23:08:55 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14975 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/skin.cpp | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'plugins/Popup/src/skin.cpp') diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 723b6f6a41..544069e276 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -344,7 +344,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options } else { HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock); - SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz); + GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz); SelectObject(hdc, hfnSave); wnd->getArgs()->add("clock.width", sz.cx + 2 * STYLE_SZ_GAP); wnd->getArgs()->add("clock.height", sz.cy); @@ -483,16 +483,15 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW else SetTextColor(hdc, wnd->getTextColor()); { - POINT pos; - pos.x = head->fx.eval(wnd->getArgs()); - pos.y = head->fy.eval(wnd->getArgs()); - SIZE sz; + POINT pt; + pt.x = head->fx.eval(wnd->getArgs()); + pt.y = head->fy.eval(wnd->getArgs()); sz.cx = wnd->getRenderInfo()->textw; sz.cy = 1000; - SetRect(&wnd->getRenderInfo()->textRect, pos.x, pos.y, - pos.x + wnd->getRenderInfo()->realtextw, - pos.y + wnd->getRenderInfo()->texth); + SetRect(&wnd->getRenderInfo()->textRect, pt.x, pt.y, + pt.x + wnd->getRenderInfo()->realtextw, + pt.y + wnd->getRenderInfo()->texth); if ((drawFlags&DF_STATIC) && !wnd->isTextEmpty()) { HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.text); @@ -500,13 +499,13 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW switch (wnd->getTextType()) { case PopupWnd2::TT_UNICODE: { - RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy); + RECT rc; SetRect(&rc, pt.x, pt.y, pt.x + sz.cx, pt.y + sz.cy); DrawTextEx(hdc, wnd->getText(), (int)mir_tstrlen(wnd->getText()), &rc, DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL); } break; case PopupWnd2::TT_MTEXT: - MText.Display(hdc, pos, sz, wnd->getTextM()); + MText.Display(hdc, pt, sz, wnd->getTextM()); break; } SelectObject(hdc, hFntSave); @@ -519,12 +518,12 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW drawActionBar(bmp, wnd, db_get_b(NULL, MODULNAME, "CenterActions", 0) ? - (pos.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) : + (pt.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) : (PopupOptions.actions&ACT_RIGHTICONS) ? - (pos.x + textAreaWidth - wnd->getRenderInfo()->actw) : + (pt.x + textAreaWidth - wnd->getRenderInfo()->actw) : // else - pos.x, - pos.y + wnd->getRenderInfo()->texth + 3); + pt.x, + pt.y + wnd->getRenderInfo()->texth + 3); actionsRendered = true; } @@ -538,10 +537,9 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SetTextColor(hdc, wnd->getTitleColor()); { bmp->saveAlpha(); - POINT pos; - pos.x = head->fx.eval(wnd->getArgs()); - pos.y = head->fy.eval(wnd->getArgs()); - SIZE sz; + POINT pt; + pt.x = head->fx.eval(wnd->getArgs()); + pt.y = head->fy.eval(wnd->getArgs()); sz.cx = wnd->getRenderInfo()->titlew; sz.cy = 1000; @@ -549,7 +547,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW case PopupWnd2::TT_UNICODE: { HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title); - RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy); + RECT rc; SetRect(&rc, pt.x, pt.y, pt.x + sz.cx, pt.y + sz.cy); DrawTextEx(hdc, wnd->getTitle(), (int)mir_tstrlen(wnd->getTitle()), &rc, DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL); SelectObject(hdc, hFntSave); @@ -557,7 +555,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW break; case PopupWnd2::TT_MTEXT: HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title); - MText.Display(hdc, pos, sz, wnd->getTitleM()); + MText.Display(hdc, pt, sz, wnd->getTitleM()); SelectObject(hdc, hFntSave); break; } @@ -690,7 +688,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SetTextColor(hdc, wnd->getClockColor()); HFONT hfnSave = (HFONT)SelectObject(bmp->getDC(), fonts.clock); - SIZE sz; GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz); + GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz); bmp->Draw_Text(wnd->getTime(), x, y); SelectObject(bmp->getDC(), hfnSave); } @@ -1115,7 +1113,7 @@ bool Skins::load() if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(_T("."), ffd.cFileName) && mir_tstrcmp(_T(".."), ffd.cFileName)) { SetCurrentDirectory(ffd.cFileName); - SKINLIST *skin = new SKINLIST; + skin = new SKINLIST; skin->next = m_skins; m_skins = skin; m_skins->name = mir_tstrdup(ffd.cFileName); -- cgit v1.2.3