riched20: Don't return DLGC_HASSETSEL from WM_GETDLGCODE if the control style includes ES_SAVESEL.

This commit is contained in:
Hans Leidekker 2014-03-28 17:41:52 +01:00 committed by Alexandre Julliard
parent 5963d7f09c
commit db094db851
2 changed files with 14 additions and 1 deletions

View file

@ -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:

View file

@ -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)