Module: wine Branch: master Commit: ca2b70b2855be5f0166a639a07e43c2b3e877ed2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ca2b70b2855be5f0166a639a07...
Author: Christoph von Wittich Christoph_vW@ReactOS.org Date: Sun Mar 29 22:07:50 2015 +0200
riched20: Handle SCF_WORD.
---
dlls/riched20/caret.c | 2 +- dlls/riched20/editor.c | 8 ++++++-- dlls/riched20/editor.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 043a32a..e3e42cc 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -710,7 +710,7 @@ int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) }
-static BOOL +BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) { ME_DisplayItem *pRun = cursor->pRun, *pOtherRun; diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 171ec69..a4403ca 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3510,8 +3510,12 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, if (editor->mode & TM_PLAINTEXT) return 0; if (wParam & SCF_WORD) { - FIXME("EM_SETCHARFORMAT: word selection not supported\n"); - return 0; + ME_Cursor start; + ME_Cursor end = editor->pCursors[0]; + ME_MoveCursorWords(editor, &end, +1); + start = end; + ME_MoveCursorWords(editor, &start, -1); + ME_SetCharFormat(editor, &start, &end, p); } bRepaint = ME_IsSelection(editor); ME_SetSelectionCharFormat(editor, p); diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index e4c13a9..e2b837a 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -166,6 +166,7 @@ void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) DECLSPEC_ /* caret.c */ void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN; int ME_SetSelection(ME_TextEditor *editor, int from, int to) DECLSPEC_HIDDEN; +BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) DECLSPEC_HIDDEN; void ME_HideCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN; void ME_ShowCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN; void ME_MoveCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;