[PATCH 2/2] user32/edit: Move the call to EDIT_EM_SetSel outside the block

Gabriel Iv─âncescu gabrielopcode at gmail.com
Wed Aug 22 15:50:52 CDT 2018


Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
---

It's called in every block anyway including the else block.

 dlls/user32/edit.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 96ecbec..4e241b6 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -3474,19 +3474,17 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
 				else
 					EDIT_WM_Clear(es);
 			} else {
+				EDIT_EM_SetSel(es, (UINT)-1, 0, FALSE);
 				if (shift) {
 					/* delete character left of caret */
-					EDIT_EM_SetSel(es, (UINT)-1, 0, FALSE);
 					EDIT_MoveBackward(es, TRUE);
 					EDIT_WM_Clear(es);
 				} else if (control) {
 					/* delete to end of line */
-					EDIT_EM_SetSel(es, (UINT)-1, 0, FALSE);
 					EDIT_MoveEnd(es, TRUE, FALSE);
 					EDIT_WM_Clear(es);
 				} else {
 					/* delete character right of caret */
-					EDIT_EM_SetSel(es, (UINT)-1, 0, FALSE);
 					EDIT_MoveForward(es, TRUE);
 					EDIT_WM_Clear(es);
 				}
-- 
1.9.1




More information about the wine-devel mailing list