Dylan Smith : richedit: bCaretAtEnd should not be reset from rewrapping text.

Alexandre Julliard julliard at winehq.org
Wed Jun 25 04:47:45 CDT 2008


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

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Mon Jun 23 17:09:58 2008 -0400

richedit: bCaretAtEnd should not be reset from rewrapping text.

The bCaretAtEnd value in ME_TextEditor is used to identify that the
caret is at the end of a wrapped line instead of the start of the next
line in the paragraph since both these positions correspond to the
same position in the document. The bCaretAtEnd value was previously
being set back to FALSE whenever the window was resized.

---

 dlls/riched20/caret.c |    4 ----
 dlls/riched20/run.c   |    6 +-----
 2 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 0ae034c..02c375c 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -164,7 +164,6 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
   ME_DisplayItem *pCursorRun = pCursor->pRun;
   ME_DisplayItem *pSizeRun = pCursor->pRun;
 
-  assert(!pCursor->nOffset || !editor->bCaretAtEnd);
   assert(height && x && y);
   assert(!(ME_GetParagraph(pCursorRun)->member.para.nFlags & MEPF_REWRAP));
   assert(pCursor->pRun);
@@ -1179,9 +1178,6 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor)
 static void ME_ArrowHome(ME_TextEditor *editor, ME_Cursor *pCursor)
 {
   ME_DisplayItem *pRow = ME_FindItemBack(pCursor->pRun, diStartRow);
-  /* bCaretAtEnd doesn't make sense if the cursor isn't set at the
-  first character of the next row */
-  assert(!editor->bCaretAtEnd || !pCursor->nOffset);
   ME_WrapMarkedParagraphs(editor);
   if (pRow) {
     ME_DisplayItem *pRun;
diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c
index 0af3ba0..805975c 100644
--- a/dlls/riched20/run.c
+++ b/dlls/riched20/run.c
@@ -241,11 +241,7 @@ void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p)
   assert(p->member.run.nCharOfs != -1);
   ME_GetParagraph(p)->member.para.nFlags |= MEPF_REWRAP;
 
-  /* if we were at the end of screen line, and the next run is in the new
-	 * line, then it's not the end of the line anymore */  
-	if (editor->bCaretAtEnd && editor->pCursors[0].pRun == pNext)
-    editor->bCaretAtEnd = FALSE;
-	/* Update all cursors so that they don't contain the soon deleted run */
+  /* Update all cursors so that they don't contain the soon deleted run */
   for (i=0; i<editor->nCursors; i++) {
     if (editor->pCursors[i].pRun == pNext) {
       editor->pCursors[i].pRun = p;




More information about the wine-cvs mailing list