This fixes an old regression when VK_RETURN handling was implemented
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=23282 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/riched20/editor.c | 2 -- dlls/riched20/tests/editor.c | 19 +++++++++++++++++++ dlls/riched32/tests/editor.c | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 99c87bf61d..a9956d5d2f 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2637,8 +2637,6 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) else if (!editor->bEmulateVersion10) ME_InsertTextFromCursor(editor, 0, &endl, 1, eop_style); - else - ME_InsertTextFromCursor(editor, 0, endlv10, 2, eop_style); ME_CommitCoalescingUndo(editor); SetCursor(NULL);
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 035869e134..b3e8c75fa4 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -8920,6 +8920,24 @@ static void test_EM_SELECTIONTYPE(void) DestroyWindow(hwnd); }
+static void test_VK_RETURN(void) +{ + HWND hwnd_richedit = new_richedit(NULL); + char buffer[100]; + GETTEXTEX gettex = {sizeof(buffer)}; + int len; + + SendMessageW(hwnd_richedit, WM_CHAR, 'T', 0); + SendMessageW(hwnd_richedit, WM_KEYDOWN, VK_RETURN, 0); + SendMessageW(hwnd_richedit, WM_CHAR, 'S', 0); + SendMessageW(hwnd_richedit, WM_KEYDOWN, VK_RETURN, 0); + + len = SendMessageA(hwnd_richedit, EM_GETTEXTEX, &gettex, buffer); + + ok(len == 4, "Got %d\n", len); + ok(strcmp(buffer, "T\rS\r") == 0, "Got %s\n", buffer); +} + START_TEST( editor ) { BOOL ret; @@ -8995,6 +9013,7 @@ START_TEST( editor ) test_eop_char_fmt(); test_para_numbering(); test_EM_SELECTIONTYPE(); + test_VK_RETURN();
/* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 7751d2b402..8cb28fa773 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -1412,6 +1412,24 @@ static void test_EM_SETSEL(void) DestroyWindow(hwndRichEdit); }
+static void test_VK_RETURN(void) +{ + HWND hwnd_richedit = new_richedit(NULL); + char buffer[100]; + GETTEXTEX gettex = {sizeof(buffer)}; + int len; + + SendMessageW(hwnd_richedit, WM_CHAR, 'T', 0); + SendMessageW(hwnd_richedit, WM_KEYDOWN, VK_RETURN, 0); + SendMessageW(hwnd_richedit, WM_CHAR, 'S', 0); + SendMessageW(hwnd_richedit, WM_KEYDOWN, VK_RETURN, 0); + + len = SendMessageA(hwnd_richedit, EM_GETTEXTEX, &gettex, buffer); + + ok(len == 2, "Got %d\n", len); + ok(strcmp(buffer, "TS") == 0, "Got %s\n", buffer); +} + START_TEST( editor ) { MSG msg; @@ -1440,6 +1458,7 @@ START_TEST( editor ) test_enter(); test_EM_EXSETSEL(); test_EM_SETSEL(); + test_VK_RETURN();
/* Set the environment variable WINETEST_RICHED32 to keep windows * responsive and open for 30 seconds. This is useful for debugging.
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=45581
Your paranoid android.
=== debian9 (32 bit report) ===
riched32: editor.c:1206: Test failed: [0] WM_GETTEXT unexpected '6161616262620d0a' expected '6161610d0a6262620d0a' editor.c:1228: Test failed: [0] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1250: Test failed: [0] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1206: Test failed: [1] WM_GETTEXT unexpected '6161616262620d0a' expected '6161616262620d0a0d0a' editor.c:1228: Test failed: [1] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1250: Test failed: [1] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1206: Test failed: [2] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d616262620d0a0d0a' editor.c:1228: Test failed: [2] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1250: Test failed: [2] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1206: Test failed: [3] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0d0a616262620d0a' editor.c:1228: Test failed: [3] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1250: Test failed: [3] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1206: Test failed: [4] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0a0d616262620d0a' editor.c:1228: Test failed: [4] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a' editor.c:1250: Test failed: [4] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a'
=== debian9 (32 bit French report) ===
riched32: editor.c:1206: Test failed: [0] WM_GETTEXT unexpected '6161616262620d0a' expected '6161610d0a6262620d0a' editor.c:1228: Test failed: [0] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1250: Test failed: [0] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1206: Test failed: [1] WM_GETTEXT unexpected '6161616262620d0a' expected '6161616262620d0a0d0a' editor.c:1228: Test failed: [1] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1250: Test failed: [1] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1206: Test failed: [2] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d616262620d0a0d0a' editor.c:1228: Test failed: [2] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1250: Test failed: [2] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1206: Test failed: [3] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0d0a616262620d0a' editor.c:1228: Test failed: [3] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1250: Test failed: [3] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1206: Test failed: [4] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0a0d616262620d0a' editor.c:1228: Test failed: [4] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a' editor.c:1250: Test failed: [4] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a'
=== debian9 (32 bit Japanese:Japan report) ===
riched32: editor.c:1206: Test failed: [0] WM_GETTEXT unexpected '6161616262620d0a' expected '6161610d0a6262620d0a' editor.c:1228: Test failed: [0] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1250: Test failed: [0] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1206: Test failed: [1] WM_GETTEXT unexpected '6161616262620d0a' expected '6161616262620d0a0d0a' editor.c:1228: Test failed: [1] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1250: Test failed: [1] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1206: Test failed: [2] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d616262620d0a0d0a' editor.c:1228: Test failed: [2] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1250: Test failed: [2] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1206: Test failed: [3] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0d0a616262620d0a' editor.c:1228: Test failed: [3] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1250: Test failed: [3] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1206: Test failed: [4] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0a0d616262620d0a' editor.c:1228: Test failed: [4] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a' editor.c:1250: Test failed: [4] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a'
=== debian9 (32 bit Chinese:China report) ===
riched32: editor.c:1206: Test failed: [0] WM_GETTEXT unexpected '6161616262620d0a' expected '6161610d0a6262620d0a' editor.c:1228: Test failed: [0] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1250: Test failed: [0] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1206: Test failed: [1] WM_GETTEXT unexpected '6161616262620d0a' expected '6161616262620d0a0d0a' editor.c:1228: Test failed: [1] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1250: Test failed: [1] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1206: Test failed: [2] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d616262620d0a0d0a' editor.c:1228: Test failed: [2] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1250: Test failed: [2] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1206: Test failed: [3] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0d0a616262620d0a' editor.c:1228: Test failed: [3] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1250: Test failed: [3] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1206: Test failed: [4] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0a0d616262620d0a' editor.c:1228: Test failed: [4] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a' editor.c:1250: Test failed: [4] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a'
=== debian9 (32 bit WoW report) ===
riched32: editor.c:1206: Test failed: [0] WM_GETTEXT unexpected '6161616262620d0a' expected '6161610d0a6262620d0a' editor.c:1228: Test failed: [0] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1250: Test failed: [0] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1206: Test failed: [1] WM_GETTEXT unexpected '6161616262620d0a' expected '6161616262620d0a0d0a' editor.c:1228: Test failed: [1] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1250: Test failed: [1] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1206: Test failed: [2] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d616262620d0a0d0a' editor.c:1228: Test failed: [2] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1250: Test failed: [2] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1206: Test failed: [3] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0d0a616262620d0a' editor.c:1228: Test failed: [3] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1250: Test failed: [3] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1206: Test failed: [4] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0a0d616262620d0a' editor.c:1228: Test failed: [4] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a' editor.c:1250: Test failed: [4] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a'
=== debian9 (64 bit WoW report) ===
riched32: editor.c:1206: Test failed: [0] WM_GETTEXT unexpected '6161616262620d0a' expected '6161610d0a6262620d0a' editor.c:1228: Test failed: [0] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1250: Test failed: [0] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161610d0a6262620d0a' editor.c:1206: Test failed: [1] WM_GETTEXT unexpected '6161616262620d0a' expected '6161616262620d0a0d0a' editor.c:1228: Test failed: [1] EM_GETTEXTEX, GT_DEFAULT unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1250: Test failed: [1] EM_GETTEXTEX, GT_USECRLF unexpected '6161616262620d0a', expected '6161616262620d0a0d0a' editor.c:1206: Test failed: [2] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d616262620d0a0d0a' editor.c:1228: Test failed: [2] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1250: Test failed: [2] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d616262620d0a0d0a' editor.c:1206: Test failed: [3] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0d0a616262620d0a' editor.c:1228: Test failed: [3] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1250: Test failed: [3] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0d0a616262620d0a' editor.c:1206: Test failed: [4] WM_GETTEXT unexpected '61610d616262620d0a' expected '61610d0a0d616262620d0a' editor.c:1228: Test failed: [4] EM_GETTEXTEX, GT_DEFAULT unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a' editor.c:1250: Test failed: [4] EM_GETTEXTEX, GT_USECRLF unexpected '61610d616262620d0a', expected '61610d0a0d616262620d0a'
This patch is broken, I've sent a new patchset.
Fabian Maurer