[1/2] [try3] Richedit: fix bug 14280, EM_SETTEXTTEX obeys ST_SELECTION with RTF inputs

Dustin Brody ne4 at parsoma.net
Mon Jul 28 20:24:48 CDT 2008


* Richedit: fix bug 14280, EM_SETTEXTTEX obeys ST_SELECTION with RTF inputs

EM_SETTEXTEX which supposedly obeys ST_SELECTION (see
http://msdn.microsoft.com/en-us/library/bb787954(VS.85).aspx ) but
the EM_SETTEXTEX handler ignores it, calling
ME_StreamInRTFString(editor, 0, (char *)lParam);" either way, which
via ME_StreamInRTFString causes ME_StreamIn to delete the entire
buffer and not just just that one selection. This patch fixes that
behaviour by calling ME_StreamInRTFString to trigger SFF_SELECTION
being passed to ME_StreamIn.

I have checked that Windows XP does obey the ST_SELECTION flag as
documented by MSDN.

---
 dlls/riched20/editor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index a801ee2..1e5a395 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2308,7 +2308,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
       style = ME_GetSelectionInsertStyle(editor);
       ME_InternalDeleteText(editor, from, to - from);
       if (pStruct->codepage != 1200 && lParam && !strncmp((char *)lParam, "{\\rtf", 5))
-          ME_StreamInRTFString(editor, 0, (char *)lParam);
+          ME_StreamInRTFString(editor, 1, (char *)lParam);
       else ME_InsertTextFromCursor(editor, 0, wszText, len, style);
       ME_ReleaseStyle(style);
 
-- 
1.5.4.3




More information about the wine-patches mailing list