[COMCTL32] Edit: Fix rectangle overflow when inserting characters
authorStanislav Motylkov <x86corez@gmail.com>
Tue, 19 Mar 2019 23:39:47 +0000 (02:39 +0300)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Sat, 23 Mar 2019 14:52:43 +0000 (15:52 +0100)
Based on patch by JIRA contributor 'I_Kill_Bugs'. CORE-11475

dll/win32/comctl32/edit.c

index e2f47d0..11d1b18 100644 (file)
@@ -720,7 +720,11 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
                if ((es->style & ES_CENTER) || (es->style & ES_RIGHT))
                        rc.left = es->format_rect.left;
                else
+#ifdef __REACTOS__ /* CORE-11475 */
+                       rc.left = (short)LOWORD(EDIT_EM_PosFromChar(es, nstart_index, FALSE));
+#else
                         rc.left = LOWORD(EDIT_EM_PosFromChar(es, nstart_index, FALSE));
+#endif
                rc.right = es->format_rect.right;
                SetRectRgn(hrgn, rc.left, rc.top, rc.right, rc.bottom);