comctl32: toolbar[2/8]: the string should be included in the height of a button-less toolbar only if there is a string in the pool

Mikołaj Zalewski mikolaj at zalewski.pl
Wed Nov 1 15:47:20 CST 2006


The tests for this and the next patches will be in the last mail. 
Checking after every patch where todo_wine is needed would require some 
work so I decided to send the tests after the patches that makes them pass.

Adding the string height only when there is a string in the pool not 
only matches the Windows behaviour but also allows to remove a hack 
(which is not always correct) in TOOLBAR_GetButtonSize.
-------------- next part --------------
From 8b4dd906e2e6f9be738968ca18124103a0c30e87 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Wed, 1 Nov 2006 21:24:56 +0100
Subject: [PATCH] comctl32: toolbar: the string should be included in the height of a button-less toolbar only if there is a string in the pool

---
 dlls/comctl32/toolbar.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 1a6f603..2024314 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -1226,7 +1226,7 @@ TOOLBAR_CalcStrings (HWND hwnd, LPSIZE l
     hdc = GetDC (hwnd);
     hOldFont = SelectObject (hdc, infoPtr->hFont);
 
-    if (infoPtr->nNumButtons == 0)
+    if (infoPtr->nNumButtons == 0 && infoPtr->nNumStrings > 0)
     {
         TEXTMETRICW tm;
 
@@ -3460,11 +3460,8 @@ TOOLBAR_GetButtonSize (HWND hwnd)
 {
     TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
 
-    if (infoPtr->nNumButtons > 0)
-	return MAKELONG((WORD)infoPtr->nButtonWidth,
-			(WORD)infoPtr->nButtonHeight);
-    else
-	return MAKELONG(23,22);
+    return MAKELONG((WORD)infoPtr->nButtonWidth,
+                    (WORD)infoPtr->nButtonHeight);
 }
 
 
-- 
1.4.2.3


More information about the wine-patches mailing list