Commit 93b5bcc6 authored by Peter Urbanec's avatar Peter Urbanec Committed by Alexandre Julliard

comctl32: Add a check for setting number of parts in the statusbar to zero.

parent a22096c9
...@@ -665,6 +665,8 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts) ...@@ -665,6 +665,8 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
TRACE("(%d,%p)\n", count, parts); TRACE("(%d,%p)\n", count, parts);
if(!count) return FALSE;
oldNumParts = infoPtr->numParts; oldNumParts = infoPtr->numParts;
infoPtr->numParts = count; infoPtr->numParts = count;
if (oldNumParts > infoPtr->numParts) { if (oldNumParts > infoPtr->numParts) {
......
...@@ -382,6 +382,12 @@ static void test_status_control(void) ...@@ -382,6 +382,12 @@ static void test_status_control(void)
/* Reset number of parts */ /* Reset number of parts */
r = SendMessage(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts); r = SendMessage(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts);
expect(TRUE,r); expect(TRUE,r);
r = SendMessage(hWndStatus, SB_GETPARTS, 0, 0);
ok(r == 2, "Expected 2, got %d\n", r);
r = SendMessage(hWndStatus, SB_SETPARTS, 0, 0);
expect(FALSE,r);
r = SendMessage(hWndStatus, SB_GETPARTS, 0, 0);
ok(r == 2, "Expected 2, got %d\n", r);
/* Set the minimum height and get rectangle information again */ /* Set the minimum height and get rectangle information again */
SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0); SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment