Igor Tarasov : comctl32: Fix regression caused by 2d751ee56afced908d0788b936fa4aac1b29f1a1.
Alexandre Julliard
julliard at winehq.org
Mon Apr 20 11:33:07 CDT 2009
Module: wine
Branch: master
Commit: c037b333c889729b5c1dd5150fdc6310d676cd62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c037b333c889729b5c1dd5150fdc6310d676cd62
Author: Igor Tarasov <tarasov.igor at gmail.com>
Date: Sat Apr 18 06:51:40 2009 +0500
comctl32: Fix regression caused by 2d751ee56afced908d0788b936fa4aac1b29f1a1.
Fixing regression produced by "comctl32: Correct handling of toolbar
separators size". As it came out, some applications DO rely on iBitmap
value, but it can be received not with TB_GETBUTTONINFO, but with
TB_GETBITMAP.
---
dlls/comctl32/toolbar.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index fe4c539..faac97c 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -1331,7 +1331,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/* horizontal separators are treated as buttons for width */
else if ((btnPtr[i].fsStyle & BTNS_SEP) &&
!(infoPtr->dwStyle & CCS_VERT))
- cx = SEPARATOR_WIDTH;
+ cx = (btnPtr[i].iBitmap > 0) ? btnPtr[i].iBitmap : SEPARATOR_WIDTH;
else
cx = infoPtr->nButtonWidth;
@@ -1683,11 +1683,12 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
if (btnPtr->fsStyle & BTNS_SEP) {
if (infoPtr->dwStyle & CCS_VERT) {
- cy = SEPARATOR_WIDTH;
- cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nButtonWidth;
+ cy = (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH;
+ cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nWidth;
}
else
- cx = (btnPtr->cx > 0) ? btnPtr->cx : SEPARATOR_WIDTH;
+ cx = (btnPtr->cx > 0) ? btnPtr->cx :
+ (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH;
}
else
{
@@ -1835,11 +1836,7 @@ TOOLBAR_InternalInsertButtonsT(TOOLBAR_INFO *infoPtr, INT iIndex, UINT nAddButto
ZeroMemory(btnPtr, sizeof(*btnPtr));
- /* When inserting separator, iBitmap controls it's size */
- if (lpTbb[iButton].fsStyle & BTNS_SEP) {
- btnPtr->cx = lpTbb[iButton].iBitmap;
- } else
- btnPtr->iBitmap = lpTbb[iButton].iBitmap;
+ btnPtr->iBitmap = lpTbb[iButton].iBitmap;
btnPtr->idCommand = lpTbb[iButton].idCommand;
btnPtr->fsState = lpTbb[iButton].fsState;
btnPtr->fsStyle = lpTbb[iButton].fsStyle;
More information about the wine-cvs
mailing list