UPDOWN_GetBuddyInt should not fail when the control is empty.

This commit is contained in:
C. Scott Ananian 2005-03-18 14:09:12 +00:00 committed by Alexandre Julliard
parent 523d94ae4c
commit f65e415d64
2 changed files with 5 additions and 2 deletions

View File

@ -77,7 +77,7 @@ static void test_updown_control (void)
hWndUpDown = create_updown_control (hWndEdit);
/* before we set a value, it should be '0' */
num = SendMessage(hWndUpDown, UDM_GETPOS, 0, 0L);
todo_wine { ok(num == 0, "Expected 0 got %d\n", num); }
ok(num == 0, "Expected 0 got %d\n", num);
/* set a value, check it. */
SendMessage(hWndUpDown, UDM_SETPOS, 0L, MAKELONG( 1, 0));
num = SendMessage(hWndUpDown, UDM_GETPOS, 0, 0L);

View File

@ -273,7 +273,10 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
if(newVal < 0) return FALSE;
} else {
/* we have a regular window, so will get the text */
if (!GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt))) return FALSE;
/* note that a zero-length string is a legitimate value for 'txt',
* and ought to result in a successful conversion to '0'. */
if (GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt)) < 0)
return FALSE;
sep = UPDOWN_GetThousandSep();