[PATCH 5/6] riched20: Use a run ptr in GetXForArrow().

Huw Davies huw at codeweavers.com
Thu Oct 15 04:24:26 CDT 2020


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 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;
   }
-- 
2.23.0




More information about the wine-devel mailing list