riched20: ME_SetSelection -1 to -1 behavior fix
Mark Lu
excelblue at gmail.com
Sat Sep 2 16:28:47 CDT 2006
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
More information about the wine-patches
mailing list