Huw Davies : riched20: Allow the cursor offset to be equal to the run length - this implies the cursor is at the end of the run , which isn't necessarily the start of the next.

Alexandre Julliard julliard at winehq.org
Tue Feb 26 13:48:15 CST 2013


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Feb 26 13:19:50 2013 +0000

riched20: Allow the cursor offset to be equal to the run length - this implies the cursor is at the end of the run, which isn't necessarily the start of the next.

---

 dlls/riched20/caret.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 82b8e1d..849e500 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -884,14 +884,10 @@ static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow,
     }
     if (x >= run_x && x < run_x+width)
     {
-      int ch = ME_CharFromPoint(editor, x-run_x, &pNext->member.run, TRUE);
-      if (ch < pNext->member.run.len)
-      {
-        cursor->nOffset = ch;
-        cursor->pRun = pNext;
-        cursor->pPara = ME_GetParagraph( cursor->pRun );
-        return TRUE;
-      }
+      cursor->nOffset = ME_CharFromPoint(editor, x-run_x, &pNext->member.run, TRUE);
+      cursor->pRun = pNext;
+      cursor->pPara = ME_GetParagraph( cursor->pRun );
+      return TRUE;
     }
     pLastRun = pNext;
     pNext = ME_FindItemFwd(pNext, diRunOrStartRow);




More information about the wine-cvs mailing list