[PATCH v2 1/2] comctl32/edit: Move common calls outside the blocks

Gabriel Iv─âncescu gabrielopcode at gmail.com
Thu Aug 23 05:55:03 CDT 2018


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

v2: Move more stuff outside the blocks and use ~0

This supersedes 150050.

 dlls/comctl32/edit.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c
index 10ff5fb..3895dc5 100644
--- a/dlls/comctl32/edit.c
+++ b/dlls/comctl32/edit.c
@@ -3308,22 +3308,17 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
 				else
 					EDIT_WM_Clear(es);
 			} else {
-				if (shift) {
+				EDIT_EM_SetSel(es, ~0, 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) {
+				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 {
+				else
 					/* delete character right of caret */
-					EDIT_EM_SetSel(es, (UINT)-1, 0, FALSE);
 					EDIT_MoveForward(es, TRUE);
-					EDIT_WM_Clear(es);
-				}
+				EDIT_WM_Clear(es);
 			}
 		}
 		break;
-- 
1.9.1




More information about the wine-devel mailing list