Dylan Smith : richedit: Support ascii RTF in WM_SETTEXT even for unicode messages.
Alexandre Julliard
julliard at winehq.org
Mon Jul 13 07:55:33 CDT 2009
Module: wine
Branch: master
Commit: 88c2b90aa63b3a893f6edc0ffb4f652889a02c39
URL: http://source.winehq.org/git/wine.git/?a=commit;h=88c2b90aa63b3a893f6edc0ffb4f652889a02c39
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Fri Jul 10 23:54:34 2009 -0400
richedit: Support ascii RTF in WM_SETTEXT even for unicode messages.
WM_SETTEXT seems to check for {\rtf or {\urtf to determine if it is an
ascii RTF string, even if it is a unicode message. So I removed the
check to see if it is a unicode message, and added a check for {\urtf.
---
dlls/riched20/editor.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 278b9aa..4cd72c8 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3194,7 +3194,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
/* If we detect ascii rtf at the start of the string,
* we know it isn't unicode. */
bRtf = (lParam && (!strncmp((char *)lParam, "{\\rtf", 5) ||
- !strncmp((char *)lParam, "{\\urtf}", 6)));
+ !strncmp((char *)lParam, "{\\urtf", 6)));
bUnicode = !bRtf && pStruct->codepage == 1200;
TRACE("EM_SETTEXTEX - %s, flags %d, cp %d\n",
@@ -3463,7 +3463,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
if (lParam)
{
TRACE("WM_SETTEXT lParam==%lx\n",lParam);
- if (!unicode && !strncmp((char *)lParam, "{\\rtf", 5))
+ if (!strncmp((char *)lParam, "{\\rtf", 5) ||
+ !strncmp((char *)lParam, "{\\urtf", 6))
{
/* Undocumented: WM_SETTEXT supports RTF text */
ME_StreamInRTFString(editor, 0, (char *)lParam);
More information about the wine-cvs
mailing list