riched20: Handle tomEnd in ITextRange::ScrollIntoView.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46899
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 840af642db)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Gijs Vermeulen 2019-04-15 12:14:15 +02:00 committed by Michael Stefaniuc
parent 788ef367cc
commit 0cfe81859c
2 changed files with 8 additions and 0 deletions

View File

@ -2475,6 +2475,10 @@ static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value)
ME_CursorFromCharOfs(editor, This->start, &cursor);
ME_GetCursorCoordinates(editor, &cursor, &x, &y, &height);
break;
case tomEnd:
ME_CursorFromCharOfs(editor, This->end, &cursor);
ME_GetCursorCoordinates(editor, &cursor, &x, &y, &height);
break;
default:
FIXME("bStart value %d not handled\n", value);
return E_NOTIMPL;

View File

@ -853,15 +853,19 @@ static void test_ITextRange_ScrollIntoView(void)
/* Scroll to the top. */
check_range(w, txtDoc, 0, 1, tomStart, 0);
check_range(w, txtDoc, 0, 1, tomEnd, 0);
/* Scroll to the bottom. */
check_range(w, txtDoc, 19, 20, tomStart, 1);
check_range(w, txtDoc, 19, 20, tomEnd, 1);
/* Back up to the top. */
check_range(w, txtDoc, 0, 1, tomStart, 0);
check_range(w, txtDoc, 0, 1, tomEnd, 0);
/* Large range */
check_range(w, txtDoc, 0, 20, tomStart, 0);
check_range(w, txtDoc, 0, 20, tomEnd, 1);
hres = ITextDocument_Range(txtDoc, 0, 0, &txtRge);
ok(hres == S_OK, "got 0x%08x\n", hres);