Lei Zhang : user32: Handle ES_MULTILINE correctly for WM_KEYDOWN/VK_RETURN.

Alexandre Julliard julliard at winehq.org
Tue Apr 8 06:38:06 CDT 2008


Module: wine
Branch: master
Commit: 7f10fe07443a7eadb2b491981e69b1cbca9b5808
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7f10fe07443a7eadb2b491981e69b1cbca9b5808

Author: Lei Zhang <thestig at google.com>
Date:   Mon Apr  7 14:13:04 2008 -0700

user32: Handle ES_MULTILINE correctly for WM_KEYDOWN/VK_RETURN.

---

 dlls/user32/edit.c       |    2 +-
 dlls/user32/tests/edit.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 8afc87a..f359555 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -4596,7 +4596,7 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
 		break;
 	case VK_RETURN:
 	    /* If the edit doesn't want the return send a message to the default object */
-	    if(!(es->style & ES_WANTRETURN))
+	    if(!(es->style & ES_MULTILINE) || !(es->style & ES_WANTRETURN))
 	    {
 		HWND hwndParent = GetParent(es->hwndSelf);
 		DWORD dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 );
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index 396f74d..9542714 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -1898,7 +1898,7 @@ static void test_singleline_wantreturn_edit_dialog(void)
     r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, (DLGPROC)edit_singleline_dialog_proc, 0);
     todo_wine ok(222 == r, "Expected %d, got %d\n", 222, r);
     r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, (DLGPROC)edit_singleline_dialog_proc, 1);
-    todo_wine ok(111 == r, "Expected %d, got %d\n", 111, r);
+    ok(111 == r, "Expected %d, got %d\n", 111, r);
     r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, (DLGPROC)edit_singleline_dialog_proc, 2);
     ok(444 == r, "Expected %d, got %d\n", 444, r);
 
@@ -1914,7 +1914,7 @@ static void test_singleline_wantreturn_edit_dialog(void)
     r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, (DLGPROC)edit_singleline_dialog_proc, 6);
     todo_wine ok(222 == r, "Expected %d, got %d\n", 222, r);
     r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, (DLGPROC)edit_singleline_dialog_proc, 7);
-    todo_wine ok(111 == r, "Expected %d, got %d\n", 111, r);
+    ok(111 == r, "Expected %d, got %d\n", 111, r);
     r = DialogBoxParam(hinst, "EDIT_SINGLELINE_WANTRETURN_DIALOG", NULL, (DLGPROC)edit_singleline_dialog_proc, 8);
     ok(444 == r, "Expected %d, got %d\n", 444, r);
 }




More information about the wine-cvs mailing list