From 51936be04dc9245d17051f6e5b6b247cfa5aa466 Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Sun, 5 Jan 2014 19:10:58 +0800 Subject: [PATCH] riched20: Use CP_UNICODE instead of 1200. --- dlls/riched20/editor.c | 8 ++++---- dlls/riched20/editor.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 66dec2ddf70..119061f43c8 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1968,7 +1968,7 @@ static int ME_GetTextEx(ME_TextEditor *editor, GETTEXTEX *ex, LPARAM pText) ME_SetCursorToStart(editor, &start); nChars = INT_MAX; } - if (ex->codepage == 1200) + if (ex->codepage == CP_UNICODE) { return ME_GetTextW(editor, (LPWSTR)pText, ex->cb / sizeof(WCHAR) - 1, &start, nChars, ex->flags & GT_USECRLF); @@ -3338,7 +3338,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, * we know it isn't unicode. */ bRtf = (lParam && (!strncmp((char *)lParam, "{\\rtf", 5) || !strncmp((char *)lParam, "{\\urtf", 6))); - bUnicode = !bRtf && pStruct->codepage == 1200; + bUnicode = !bRtf && pStruct->codepage == CP_UNICODE; TRACE("EM_SETTEXTEX - %s, flags %d, cp %d\n", bUnicode ? debugstr_w((LPCWSTR)lParam) : debugstr_a((LPCSTR)lParam), @@ -3691,7 +3691,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, /* CR/LF conversion required in 2.0 mode, verbatim in 1.0 mode */ how.flags = GTL_CLOSE | (editor->bEmulateVersion10 ? 0 : GTL_USECRLF) | GTL_NUMCHARS; - how.codepage = unicode ? 1200 : CP_ACP; + how.codepage = unicode ? CP_UNICODE : CP_ACP; return ME_GetTextLengthEx(editor, &how); } case EM_GETTEXTLENGTHEX: @@ -3701,7 +3701,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, GETTEXTEX ex; ex.cb = wParam * (unicode ? sizeof(WCHAR) : sizeof(CHAR)); ex.flags = GT_USECRLF; - ex.codepage = unicode ? 1200 : CP_ACP; + ex.codepage = unicode ? CP_UNICODE : CP_ACP; ex.lpDefaultChar = NULL; ex.lpUsedDefChar = NULL; return ME_GetTextEx(editor, &ex, lParam); diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 2f2dc96c30d..40bf04cf20b 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -108,6 +108,8 @@ int ME_CallWordBreakProc(ME_TextEditor *editor, WCHAR *str, INT len, INT start, void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) DECLSPEC_HIDDEN; BOOL ME_InsertString(ME_String *s, int ofs, const WCHAR *insert, int len) DECLSPEC_HIDDEN; +#define CP_UNICODE 1200 + /* smart helpers for A<->W conversions, they reserve/free memory and call MultiByte<->WideChar functions */ LPWSTR ME_ToUnicode(BOOL unicode, LPVOID psz, INT *len) DECLSPEC_HIDDEN; void ME_EndToUnicode(BOOL unicode, LPVOID psz) DECLSPEC_HIDDEN; -- 2.11.4.GIT