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.
This commit is contained in:
Dylan Smith 2009-02-02 01:32:29 -05:00 committed by Alexandre Julliard
parent 1a3551b630
commit 8662c6fe7b
1 changed files with 4 additions and 3 deletions

View File

@ -69,7 +69,7 @@
! - EM_GETTHUMB ! - EM_GETTHUMB
+ EM_GETTEXTEX 2.0 + EM_GETTEXTEX 2.0
+ EM_GETTEXTLENGTHEX (GTL_PRECISE unimplemented) + EM_GETTEXTLENGTHEX (GTL_PRECISE unimplemented)
- EM_GETTEXTMODE 2.0 + EM_GETTEXTMODE 2.0
? + EM_GETTEXTRANGE (ANSI&Unicode) ? + EM_GETTEXTRANGE (ANSI&Unicode)
- EM_GETTYPOGRAPHYOPTIONS 3.0 - EM_GETTYPOGRAPHYOPTIONS 3.0
- EM_GETUNDONAME - EM_GETUNDONAME
@ -2680,7 +2680,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed->bHideSelection = FALSE; ed->bHideSelection = FALSE;
ed->pfnWordBreak = NULL; ed->pfnWordBreak = NULL;
ed->lpOleCallback = 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->mode |= (props & TXTBIT_RICHTEXT) ? TM_RICHTEXT : TM_PLAINTEXT;
ed->AutoURLDetect_bEnable = FALSE; ed->AutoURLDetect_bEnable = FALSE;
ed->bHaveFocus = 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_SETIMESTATUS)
UNSUPPORTED_MSG(EM_GETLANGOPTIONS) UNSUPPORTED_MSG(EM_GETLANGOPTIONS)
UNSUPPORTED_MSG(EM_GETREDONAME) UNSUPPORTED_MSG(EM_GETREDONAME)
UNSUPPORTED_MSG(EM_GETTEXTMODE)
UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS) UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS)
UNSUPPORTED_MSG(EM_GETUNDONAME) UNSUPPORTED_MSG(EM_GETUNDONAME)
UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX) UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX)
@ -4290,6 +4289,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->pfnWordBreak = (EDITWORDBREAKPROCW)lParam; editor->pfnWordBreak = (EDITWORDBREAKPROCW)lParam;
return (LRESULT)pfnOld; return (LRESULT)pfnOld;
} }
case EM_GETTEXTMODE:
return editor->mode;
case EM_SETTEXTMODE: case EM_SETTEXTMODE:
{ {
LRESULT ret; LRESULT ret;