UPDOWN_GetBuddyInt should not fail when the control is empty.
This commit is contained in:
parent
523d94ae4c
commit
f65e415d64
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue