Module: wine Branch: master Commit: db094db851292280670042d25bdc7caad6958936 URL: http://source.winehq.org/git/wine.git/?a=commit;h=db094db851292280670042d25b...
Author: Hans Leidekker hans@codeweavers.com Date: Fri Mar 28 17:41:52 2014 +0100
riched20: Don't return DLGC_HASSETSEL from WM_GETDLGCODE if the control style includes ES_SAVESEL.
---
dlls/riched20/editor.c | 5 ++++- dlls/riched20/tests/editor.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index d38d28e..1d17ef0 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3142,11 +3142,14 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, return ME_StreamOut(editor, wParam, (EDITSTREAM *)lParam); case WM_GETDLGCODE: { - UINT code = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + UINT code = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS; + if (lParam) editor->bDialogMode = TRUE; if (editor->styleFlags & ES_MULTILINE) code |= DLGC_WANTMESSAGE; + if (!(editor->styleFlags & ES_SAVESEL)) + code |= DLGC_HASSETSEL; return code; } case EM_EMPTYUNDOBUFFER: diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 2efee9a..309de7a 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -6729,6 +6729,16 @@ static void test_WM_GETDLGCODE(void) ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", res, expected); DestroyWindow(hwnd); + + hwnd = CreateWindowExA(0, RICHEDIT_CLASS20A, NULL, + WS_POPUP|ES_SAVESEL, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS20A, (int) GetLastError()); + res = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); }
static void test_zoom(void)