comctl32: Fix regression caused by 2d751ee56a.

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.
This commit is contained in:
Igor Tarasov 2009-04-18 06:51:40 +05:00 committed by Alexandre Julliard
parent 0b6d74c428
commit c037b333c8
1 changed files with 6 additions and 9 deletions

View File

@ -1331,7 +1331,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/* horizontal separators are treated as buttons for width */ /* horizontal separators are treated as buttons for width */
else if ((btnPtr[i].fsStyle & BTNS_SEP) && else if ((btnPtr[i].fsStyle & BTNS_SEP) &&
!(infoPtr->dwStyle & CCS_VERT)) !(infoPtr->dwStyle & CCS_VERT))
cx = SEPARATOR_WIDTH; cx = (btnPtr[i].iBitmap > 0) ? btnPtr[i].iBitmap : SEPARATOR_WIDTH;
else else
cx = infoPtr->nButtonWidth; cx = infoPtr->nButtonWidth;
@ -1683,11 +1683,12 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
if (btnPtr->fsStyle & BTNS_SEP) { if (btnPtr->fsStyle & BTNS_SEP) {
if (infoPtr->dwStyle & CCS_VERT) { if (infoPtr->dwStyle & CCS_VERT) {
cy = SEPARATOR_WIDTH; cy = (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH;
cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nButtonWidth; cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nWidth;
} }
else else
cx = (btnPtr->cx > 0) ? btnPtr->cx : SEPARATOR_WIDTH; cx = (btnPtr->cx > 0) ? btnPtr->cx :
(btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH;
} }
else else
{ {
@ -1835,11 +1836,7 @@ TOOLBAR_InternalInsertButtonsT(TOOLBAR_INFO *infoPtr, INT iIndex, UINT nAddButto
ZeroMemory(btnPtr, sizeof(*btnPtr)); ZeroMemory(btnPtr, sizeof(*btnPtr));
/* When inserting separator, iBitmap controls it's size */ btnPtr->iBitmap = lpTbb[iButton].iBitmap;
if (lpTbb[iButton].fsStyle & BTNS_SEP) {
btnPtr->cx = lpTbb[iButton].iBitmap;
} else
btnPtr->iBitmap = lpTbb[iButton].iBitmap;
btnPtr->idCommand = lpTbb[iButton].idCommand; btnPtr->idCommand = lpTbb[iButton].idCommand;
btnPtr->fsState = lpTbb[iButton].fsState; btnPtr->fsState = lpTbb[iButton].fsState;
btnPtr->fsStyle = lpTbb[iButton].fsStyle; btnPtr->fsStyle = lpTbb[iButton].fsStyle;