[PATCH] comctl32: statusbar: optimize STATUSBAR_RefreshPart
Mikołaj Zalewski
mikolaj at zalewski.pl
Wed Jul 16 13:55:40 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 bbab393..4d28c1b 100644
--- a/dlls/comctl32/status.c
+++ b/dlls/comctl32/status.c
@@ -249,15 +249,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;
@@ -275,18 +275,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
--------------050208040309040001030404--
More information about the wine-patches
mailing list