From 8662c6fe7b60d9ff563ba790d4431ef30250249b Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Mon, 2 Feb 2009 01:32:29 -0500 Subject: [PATCH] richedit: Implement EM_GETTEXTMODE. The text mode is already stored, and EM_SETTEXTMODE already exists. There was however a bug in EM_MakeEditor that could cause TM_PLAINTEXT and TM_RICHEDIT to be set at the same time. This was corrected to ensure EM_GETTEXTMODE returned the proper mode being used. --- dlls/riched20/editor.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index f875385409d..352b82765c8 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -69,7 +69,7 @@ ! - EM_GETTHUMB + EM_GETTEXTEX 2.0 + EM_GETTEXTLENGTHEX (GTL_PRECISE unimplemented) - - EM_GETTEXTMODE 2.0 + + EM_GETTEXTMODE 2.0 ? + EM_GETTEXTRANGE (ANSI&Unicode) - EM_GETTYPOGRAPHYOPTIONS 3.0 - EM_GETUNDONAME @@ -2680,7 +2680,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ed->bHideSelection = FALSE; ed->pfnWordBreak = NULL; ed->lpOleCallback = NULL; - ed->mode = TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE; + ed->mode = TM_MULTILEVELUNDO | TM_MULTICODEPAGE; ed->mode |= (props & TXTBIT_RICHTEXT) ? TM_RICHTEXT : TM_PLAINTEXT; ed->AutoURLDetect_bEnable = FALSE; ed->bHaveFocus = FALSE; @@ -2999,7 +2999,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, UNSUPPORTED_MSG(EM_SETIMESTATUS) UNSUPPORTED_MSG(EM_GETLANGOPTIONS) UNSUPPORTED_MSG(EM_GETREDONAME) - UNSUPPORTED_MSG(EM_GETTEXTMODE) UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS) UNSUPPORTED_MSG(EM_GETUNDONAME) UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX) @@ -4290,6 +4289,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, editor->pfnWordBreak = (EDITWORDBREAKPROCW)lParam; return (LRESULT)pfnOld; } + case EM_GETTEXTMODE: + return editor->mode; case EM_SETTEXTMODE: { LRESULT ret;