comctl32/datetime: Use MCM_GETRANGE result directly in DTM_GETRANGE.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-03-14 20:19:26 +03:00 committed by Alexandre Julliard
parent 6870144022
commit a62d178744
2 changed files with 8 additions and 3 deletions

View File

@ -1555,7 +1555,6 @@ static LRESULT WINAPI
DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = ((DATETIME_INFO *)GetWindowLongPtrW (hwnd, 0));
LRESULT ret;
TRACE ("%x, %lx, %lx\n", uMsg, wParam, lParam);
@ -1571,8 +1570,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DATETIME_SetSystemTime (infoPtr, wParam, (SYSTEMTIME *) lParam);
case DTM_GETRANGE:
ret = SendMessageW (infoPtr->hMonthCal, MCM_GETRANGE, wParam, lParam);
return ret ? ret : 1; /* bug emulation */
return SendMessageW (infoPtr->hMonthCal, MCM_GETRANGE, wParam, lParam);
case DTM_SETRANGE:
return SendMessageW (infoPtr->hMonthCal, MCM_SETRANGE, wParam, lParam);

View File

@ -404,6 +404,13 @@ static void test_dtm_set_and_get_range(void)
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_range_seq, "test_dtm_set_and_get_range", FALSE);
/* DTM_SETRANGE with 0 flags */
r = SendMessageA(hWnd, DTM_SETRANGE, 0, (LPARAM)st);
ok(r, "got %lu\n", r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == 0, "got %lu\n", r);
ok(getSt[0].wYear == 0 && getSt[1].wYear == 0, "got %u, %u\n", getSt[0].wYear, getSt[1].wYear);
DestroyWindow(hWnd);
}