Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47991 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/rebar.c | 6 ++++-- dlls/comctl32/tests/rebar.c | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 8c667a192b..6bca2f1818 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -1298,8 +1298,8 @@ static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT i REBAR_BAND *lpBand; int yMaxHeight = 0; int yPos = yStart; - int row = REBAR_GetBand(infoPtr, iBeginBand)->iRow; - int i; + int row, i; + for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i)) { lpBand = REBAR_GetBand(infoPtr, i); @@ -1308,6 +1308,8 @@ static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT i } TRACE("Bands [%d; %d) height: %d\n", iBeginBand, iEndBand, yMaxHeight);
+ row = iBeginBand < iEndBand ? REBAR_GetBand(infoPtr, iBeginBand)->iRow : 0; + for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i)) { lpBand = REBAR_GetBand(infoPtr, i); diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 3b1be77497..6c82295d40 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -499,6 +499,7 @@ static void test_layout(void) REBARBANDINFOA rbi; HIMAGELIST himl; REBARINFO ri; + int count;
rbsize_results_init();
@@ -660,9 +661,27 @@ static void test_layout(void) SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); check_sizes();
- rbsize_results_free(); DestroyWindow(hRebar); pImageList_Destroy(himl); + + /* One hidden band. */ + hRebar = create_rebar_control(); + + rbi.cbSize = REBARBANDINFOA_V6_SIZE; + rbi.fMask = RBBIM_STYLE | RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD; + rbi.fStyle = RBBS_HIDDEN; + rbi.cx = 200; + rbi.cxMinChild = 100; + rbi.cyMinChild = 30; + rbi.hwndChild = NULL; + + SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi); + count = SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0); + ok(!count, "Unexpected row count %d.\n", count); + + DestroyWindow(hRebar); + + rbsize_results_free(); }
#if 0 /* use this to generate more tests */