Mikołaj Zalewski : comctl32: rebar: To check if an image is present iImage should be compared to -1 ( with testcase).
Alexandre Julliard
julliard at winehq.org
Thu Feb 28 06:21:35 CST 2008
Module: wine
Branch: master
Commit: 4d0bad870cc70ba34e2db95f4df44d3f829c84e8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4d0bad870cc70ba34e2db95f4df44d3f829c84e8
Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date: Wed Feb 27 17:00:37 2008 +0100
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 54f186d..5a40e32 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);
More information about the wine-cvs
mailing list