Commit 7e28fa5c 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
parent 21d25b17
......@@ -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;
}
......
......@@ -7348,7 +7348,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);
......@@ -7356,7 +7355,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);
......@@ -7364,7 +7362,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