Huw Davies : riched20: Use a run ptr in GetXForArrow().

Alexandre Julliard julliard at winehq.org
Thu Oct 15 15:41:10 CDT 2020


Module: wine
Branch: master
Commit: a9a2a68be96ede0c62dbd259cb2d1f6a7f0ec20d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a9a2a68be96ede0c62dbd259cb2d1f6a7f0ec20d

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Oct 15 10:39:41 2020 +0100

riched20: Use a run ptr in GetXForArrow().

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/caret.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 4764dec8f33..ffea3ee0c35 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -1215,21 +1215,23 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y)
 
 static int ME_GetXForArrow(ME_TextEditor *editor, ME_Cursor *pCursor)
 {
-  ME_DisplayItem *pRun = pCursor->pRun;
+  ME_Run *run = &pCursor->pRun->member.run;
   int x;
 
   if (editor->nUDArrowX != -1)
     x = editor->nUDArrowX;
-  else {
+  else
+  {
     if (editor->bCaretAtEnd)
     {
-      pRun = ME_FindItemBack(pRun, diRun);
-      assert(pRun);
-      x = pRun->member.run.pt.x + pRun->member.run.nWidth;
+      run = run_prev_all_paras( run );
+      assert( run );
+      x = run->pt.x + run->nWidth;
     }
-    else {
-      x = pRun->member.run.pt.x;
-      x += ME_PointFromChar(editor, &pRun->member.run, pCursor->nOffset, TRUE);
+    else
+    {
+      x = run->pt.x;
+      x += ME_PointFromChar( editor, run, pCursor->nOffset, TRUE );
     }
     editor->nUDArrowX = x;
   }




More information about the wine-cvs mailing list