Module: wine Branch: master Commit: fa92edfa48a0307fbed7a49a03dc55bfd360d31a URL: http://source.winehq.org/git/wine.git/?a=commit;h=fa92edfa48a0307fbed7a49a03...
Author: Ilya Shpigor shpigor@etersoft.ru Date: Wed Dec 2 11:20:05 2009 +0300
comctl32: Implementation the WM_GETTEXT processing of datetime control.
---
dlls/comctl32/datetime.c | 23 +++++++++++++++++++++++ dlls/comctl32/tests/datetime.c | 5 ++--- 2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 724cba7..a7b433d 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -1365,6 +1365,26 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr) }
+static INT +DATETIME_GetText (DATETIME_INFO *infoPtr, INT count, LPWSTR dst) +{ + WCHAR buf[80]; + int i; + + if (!dst || (count <= 0)) return 0; + + dst[0] = 0; + for (i = 0; i < infoPtr->nrFields; i++) + { + DATETIME_ReturnTxt(infoPtr, i, buf, sizeof(buf)/sizeof(buf[0])); + if ((strlenW(dst) + strlenW(buf)) < count) + strcatW(dst, buf); + else break; + } + return strlenW(dst); +} + + static LRESULT WINAPI DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -1476,6 +1496,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return (LRESULT) infoPtr->hFont;
+ case WM_GETTEXT: + return (LRESULT) DATETIME_GetText(infoPtr, wParam, (LPWSTR)lParam); + case WM_SETTEXT: return CB_ERR;
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 9218e07..a871930 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -197,7 +197,7 @@ static void test_dtm_set_format(void) r = SendMessage(hWnd, DTM_SETSYSTEMTIME, 0, (LPARAM)&systime); expect(1, r); GetWindowText(hWnd, txt, 256); - todo_wine ok(strcmp(txt, "hh 12") == 0, "String mismatch ("%s" vs "hh 12")\n", txt); + ok(strcmp(txt, "hh 12") == 0, "String mismatch ("%s" vs "hh 12")\n", txt);
DestroyWindow(hWnd); } @@ -675,8 +675,7 @@ static void test_wm_set_get_text(void) ok(strcmp(buff, a_str) != 0, "Expected text not to change, got %s\n", buff);
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time)); - todo_wine - ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff); + ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);
DestroyWindow(hWnd); }