riched20: ME_SetSelection -1 to -1 behavior fix [RESUBMISSION]

Mark Lu excelblue at gmail.com
Sat Sep 2 22:12:06 CDT 2006


ChangeLog:
* Corrects the behavior of ME_SetSelection when selecting from -1 to -1

Author: Hippocrates Sendoukas <hsendoukas at hotmail.com>
Submitter: Mark Lu <excelblue at gmail.com>

This is a resubmission because the previous one had accidental line wraps.

-- 
Mark Lu
-------------- next part --------------
From 6de8430e4689c1ed1fdf1dc0ba650f901830386d Mon Sep 17 00:00:00 2001
From: excelblue <excelblue at wave.(none)>
Date: Sat, 2 Sep 2006 14:24:11 -0700
Subject: riched20: ME_SetSelection -1 to -1 behavior fix

ChangeLog:
* Corrects the behavior of ME_SetSelection when selecting from -1 to -1

Author: Hippocrates Sendoukas <hsendoukas at hotmail.com>
Submitter: Mark Lu <excelblue at gmail.com>

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

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index bdab179..06f021c 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -90,6 +90,14 @@ void ME_SetSelection(ME_TextEditor *edit
     ME_ClearTempStyle(editor);
     return;
   }
+  if (from == -1 && to == -1)	/*-1,-1 means put the selection at the end of the text */
+  {
+    editor->pCursors[1].pRun = editor->pCursors[0].pRun = ME_FindItemBack(editor->pBuffer->pLast, diRun); 
+    editor->pCursors[1].nOffset = editor->pCursors[0].nOffset = 0; 
+    ME_InvalidateSelection(editor);
+    ME_ClearTempStyle(editor);
+    return;
+  }
   if (from == -1)
   {
     editor->pCursors[1] = editor->pCursors[0]; 
-- 
1.4.1.1


More information about the wine-patches mailing list