Gijs Vermeulen : riched20: Handle tomEnd in ITextRange::ScrollIntoView.

Alexandre Julliard julliard at winehq.org
Fri Aug 23 09:31:26 CDT 2019


Module: wine
Branch: stable
Commit: 0cfe81859cba69ca990298e1497a33b10f91dbb8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0cfe81859cba69ca990298e1497a33b10f91dbb8

Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date:   Mon Apr 15 12:14:15 2019 +0200

riched20: Handle tomEnd in ITextRange::ScrollIntoView.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46899
Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 840af642dbf8a222fdd9f40256db0a84c5279fc2)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/riched20/richole.c       | 4 ++++
 dlls/riched20/tests/richole.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 447e7d4..eca419a 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -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;
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index d3ffdce..3360986 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -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);




More information about the wine-cvs mailing list