[PATCH] comctl32: statusbar: optimize STATUSBAR_RefreshPart
Mikołaj Zalewski
mikolaj at zalewski.pl
Tue Jul 22 14:30:54 CDT 2008
---
dlls/comctl32/status.c | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c
index b0fcc35..c1214bb 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);
}
--
1.5.4
--------------040502090406040100030709--
More information about the wine-patches
mailing list