Peter Urbanec : comctl32: Add a check for setting number of parts in the statusbar to zero.
Alexandre Julliard
julliard at winehq.org
Tue Mar 1 11:07:15 CST 2011
Module: wine
Branch: master
Commit: 93b5bcc6eb50ac31509865c3c0ab77ee4e4e222a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=93b5bcc6eb50ac31509865c3c0ab77ee4e4e222a
Author: Peter Urbanec <winehq.org at urbanec.net>
Date: Tue Mar 1 12:01:42 2011 +1100
comctl32: Add a check for setting number of parts in the statusbar to zero.
---
dlls/comctl32/status.c | 2 ++
dlls/comctl32/tests/status.c | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c
index d670370..427fb76 100644
--- a/dlls/comctl32/status.c
+++ b/dlls/comctl32/status.c
@@ -665,6 +665,8 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
TRACE("(%d,%p)\n", count, parts);
+ if(!count) return FALSE;
+
oldNumParts = infoPtr->numParts;
infoPtr->numParts = count;
if (oldNumParts > infoPtr->numParts) {
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c
index c46b614..8509674 100644
--- a/dlls/comctl32/tests/status.c
+++ b/dlls/comctl32/tests/status.c
@@ -382,6 +382,12 @@ static void test_status_control(void)
/* Reset number of parts */
r = SendMessage(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts);
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 */
SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0);
More information about the wine-cvs
mailing list