From 9a70306c5356fa90a2688735ebf8cd4729f6d2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Zalewski?= <mikolaj@zalewski.pl> Date: Tue, 22 Jul 2008 21:30:54 +0200 Subject: [PATCH] comctl32: statusbar: Optimize STATUSBAR_RefreshPart. --- dlls/comctl32/status.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index b0fcc35a0d4..c1214bbea42 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -252,15 +252,15 @@ static void STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID) { HBRUSH hbrBk; - HFONT hOldFont; HTHEME theme; TRACE("item %d\n", itemID); - if (!IsWindowVisible (infoPtr->Self)) - return; if (part->bound.right < part->bound.left) return; + if (!RectVisible(hdc, &part->bound)) + return; + if ((theme = GetWindowTheme (infoPtr->Self))) { RECT cr; @@ -278,18 +278,7 @@ STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPA DeleteObject (hbrBk); } - hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont); - - STATUSBAR_DrawPart (infoPtr, hdc, part, itemID); - - SelectObject (hdc, hOldFont); - - if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) { - RECT rect; - - GetClientRect (infoPtr->Self, &rect); - STATUSBAR_DrawSizeGrip (theme, hdc, &rect); - } + STATUSBAR_DrawPart (infoPtr, hdc, part, itemID); }