From 42d141e4563044f5e7aa67c1e12bf0d3abc5fe49 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Miko=C5=82aj_Zalewski?= Date: Wed, 27 Feb 2008 17:00:37 +0100 Subject: [PATCH] comctl32: rebar: to check if an image is present iImage should be compared to -1 (with testcase) --- dlls/comctl32/rebar.c | 2 +- dlls/comctl32/tests/rebar.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 45912f2..95f5885 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -1572,7 +1572,7 @@ REBAR_ValidateBand (const REBAR_INFO *infoPtr, REBAR_BAND *lpBand) } /* image is visible */ - if ((lpBand->fMask & RBBIM_IMAGE) && (infoPtr->himl)) { + if (lpBand->iImage != -1 && (infoPtr->himl)) { lpBand->fStatus |= HAS_IMAGE; if (infoPtr->dwStyle & CCS_VERT) { header += (infoPtr->imageSize.cy + REBAR_POST_IMAGE); diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 8615cc3..0dd659c 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -261,6 +261,16 @@ rbsize_result_t rbsize_results[] = { { {328, 0, 511, 28}, 0x00, 183}, { {511, 0, 672, 28}, 0x00, 161}, { { 0, 28, 672, 56}, 0x00, 200}, }, }, + { {0, 0, 672, 40}, 40, 2, {20, 20, }, 5, { + { { 0, 0, 114, 20}, 0x00, 40}, { {114, 0, 328, 20}, 0x00, 214}, + { {328, 0, 511, 20}, 0x00, 183}, { {511, 0, 672, 20}, 0x00, 161}, + { { 0, 20, 672, 40}, 0x00, 200}, + }, }, + { {0, 0, 672, 56}, 56, 2, {28, 28, }, 5, { + { { 0, 0, 114, 28}, 0x00, 40}, { {114, 0, 328, 28}, 0x00, 214}, + { {328, 0, 511, 28}, 0x00, 183}, { {511, 0, 672, 28}, 0x00, 161}, + { { 0, 28, 672, 56}, 0x00, 200}, + }, }, { {0, 0, 672, 0}, 0, 0, {0, }, 0, {{{0, 0, 0, 0}, 0, 0}, }, }, { {0, 0, 672, 65}, 65, 1, {65, }, 3, { @@ -428,6 +438,16 @@ static void layout_test(void) SendMessage(hRebar, RB_SETBANDINFO, 1, (LPARAM)&rbi); check_sizes(); + /* after removing it everything is back to normal*/ + rbi.iImage = -1; + SendMessage(hRebar, RB_SETBANDINFO, 1, (LPARAM)&rbi); + check_sizes(); + + /* Only -1 means that the image is not present. Other invalid values increase the height */ + rbi.iImage = -2; + SendMessage(hRebar, RB_SETBANDINFO, 1, (LPARAM)&rbi); + check_sizes(); + /* VARHEIGHT resizing test on a horizontal rebar */ rebuild_rebar(&hRebar); SetWindowLong(hRebar, GWL_STYLE, GetWindowLong(hRebar, GWL_STYLE) | RBS_AUTOSIZE); -- 1.4.4.2