From 88c2b90aa63b3a893f6edc0ffb4f652889a02c39 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Fri, 10 Jul 2009 23:54:34 -0400 Subject: [PATCH] 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 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 278b9aaa843..4cd72c85cd9 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); -- 2.11.4.GIT