Commit a598f917 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

riched20: Don't set para unless committing cursor move in ME_MoveCursorWords.

Introduce a temporary variable, `other_para`, so that we don't end up returning incorrect para (with stale run) inside the output cursor. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54564 (cherry picked from commit 7e28fa5c)
parent 10425906
......@@ -802,15 +802,18 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
}
else
{
para = para_next( para );
if (!para_next( para ))
ME_Paragraph *other_para = para_next( para );
if (!para_next( other_para ))
{
if (cursor->run == run) return FALSE;
nOffset = 0;
break;
}
if (para->nFlags & MEPF_ROWSTART) para = para_next( para );
if (cursor->run == run) run = para_first_run( para );
if (other_para->nFlags & MEPF_ROWSTART) other_para = para_next( other_para );
if (cursor->run == run) {
para = other_para;
run = para_first_run( para );
}
nOffset = 0;
break;
}
......
......@@ -7231,7 +7231,6 @@ static void test_word_movement_multiline(void)
sel_start = sel_end = 0xdeadbeefUL;
SendMessageA(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
ok(sel_start == sel_end, "expected sel length to be 0, got %lu.\n", sel_end - sel_start);
todo_wine
ok(sel_start == 11, "expected sel_start to be %u, got %lu.\n", 11, sel_start);
send_ctrl_key(hwnd, VK_RIGHT);
......@@ -7239,7 +7238,6 @@ static void test_word_movement_multiline(void)
sel_start = sel_end = 0xdeadbeefUL;
SendMessageA(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
ok(sel_start == sel_end, "expected sel length to be 0, got %lu.\n", sel_end - sel_start);
todo_wine
ok(sel_start == 12, "expected sel_start to be %u, got %lu.\n", 12, sel_start);
send_ctrl_key(hwnd, VK_LEFT);
......@@ -7247,7 +7245,6 @@ static void test_word_movement_multiline(void)
sel_start = sel_end = 0xdeadbeefUL;
SendMessageA(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
ok(sel_start == sel_end, "expected sel length to be 0, got %lu.\n", sel_end - sel_start);
todo_wine
ok(sel_start == 11, "expected sel_start to be %u, got %lu.\n", 11, sel_start);
DestroyWindow(hwnd);
......
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