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

This commit is contained in:
Peter Urbanec 2011-03-01 12:01:42 +11:00 committed by Alexandre Julliard
parent a22096c90c
commit 93b5bcc6eb
2 changed files with 8 additions and 0 deletions

View File

@ -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) {

View File

@ -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);