Author: gadamopoulos Date: Mon Jul 31 13:10:46 2017 New Revision: 75463
URL: http://svn.reactos.org/svn/reactos?rev=75463&view=rev Log: [COMCTL32] -Fix some failed tests for TB_GETMETRICS. Add support for button spacing.
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar.... ============================================================================== --- trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] Mon Jul 31 13:10:46 2017 @@ -1867,14 +1867,14 @@ if( bWrap ) { if ( !(btnPtr->fsStyle & BTNS_SEP) ) - y += cy; + y += cy + infoPtr->szSpacing.cy; else { if ( !(infoPtr->dwStyle & CCS_VERT)) y += cy + ( (btnPtr->cx > 0 ) ? btnPtr->cx : SEPARATOR_WIDTH) * 2 /3; else - y += cy; + y += cy + infoPtr->szSpacing.cy;
/* nSepRows is used to calculate the extra height following */ /* the last row. */ @@ -1888,7 +1888,7 @@ nRows++; } else - x += cx; + x += cx + infoPtr->szSpacing.cx; }
/* infoPtr->nRows is the number of rows on the toolbar */ @@ -3660,10 +3660,8 @@ static LRESULT TOOLBAR_GetMetrics(const TOOLBAR_INFO *infoPtr, TBMETRICS *pMetrics) { - if (pMetrics == NULL) - return FALSE; - - /* TODO: check if cbSize is a valid value */ + if (pMetrics == NULL || pMetrics->cbSize != sizeof(TBMETRICS)) + return 0;
if (pMetrics->dwMask & TBMF_PAD) { @@ -3683,7 +3681,7 @@ pMetrics->cyButtonSpacing = infoPtr->szSpacing.cy; }
- return TRUE; + return 0; } #endif
@@ -6250,8 +6248,8 @@ infoPtr->szPadding.cx = DEFPAD_CX; infoPtr->szPadding.cy = DEFPAD_CY; #ifdef __REACTOS__ - infoPtr->szSpacing.cx = DEFSPACE_CX; - infoPtr->szSpacing.cy = DEFSPACE_CY; + infoPtr->szSpacing.cx = 0; + infoPtr->szSpacing.cy = 0; memset(&infoPtr->themeMargins, 0 , sizeof(infoPtr->themeMargins)); #endif infoPtr->iListGap = DEFLISTGAP;