Commit 8c43577f authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

riched20: Obtain the composition start index after deleting selection.

Today, the Rich Edit control handles the WM_IME_STARTCOMPOSITION message by the computing the composition start position (imeStartIndex) _before_ calling ME_DeleteSelection(), which shifts the character positions after the range of deletion. If the selection were not empty, imeStartIndex immediately becomes stale, since it does not take into account the number of deleted characters before it. Fix this by computing imeStartIndex after the ME_DeleteSelection() call. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54318
parent 8b0868c1
...@@ -4099,8 +4099,8 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -4099,8 +4099,8 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
return 0; return 0;
case WM_IME_STARTCOMPOSITION: case WM_IME_STARTCOMPOSITION:
{ {
editor->imeStartIndex=ME_GetCursorOfs(&editor->pCursors[0]);
ME_DeleteSelection(editor); ME_DeleteSelection(editor);
editor->imeStartIndex = ME_GetCursorOfs(&editor->pCursors[0]);
ME_CommitUndo(editor); ME_CommitUndo(editor);
ME_UpdateRepaint(editor, FALSE); ME_UpdateRepaint(editor, FALSE);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment