Mark,
This patch, like the first one you submitted, is linewrapped (meaning
it won't apply cleanly). I'd suggest just attaching the patch to your
e-mail, so you don't have to worry about these things.

Also, it's always nice to have a conformance test for things like
this. Perhaps show that it's the correct behaviour for both
EM_EXSETSEL and EM_SETSEL? If you've got any questions on writing one
(or just want me to do it for you), just send me an e-mail.

Thanks for contributing,
--Matt

On 9/2/06, Mark Lu <[EMAIL PROTECTED]> wrote:
ChangeLog:
* Corrects the behavior of ME_SetSelection when selecting from -1 to -1
---
 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






Reply via email to