Commit a62d1787 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/datetime: Use MCM_GETRANGE result directly in DTM_GETRANGE.

parent 68701440
......@@ -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);
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment