Author: akhaldi Date: Mon Apr 6 17:53:46 2015 New Revision: 67075
URL: http://svn.reactos.org/svn/reactos?rev=67075&view=rev Log: [RICHED20] Handle SCF_WORD. By Christoph von Wittich. Already accepted upstream.
Modified: trunk/reactos/dll/win32/riched20/caret.c trunk/reactos/dll/win32/riched20/editor.c trunk/reactos/dll/win32/riched20/editor.h
Modified: trunk/reactos/dll/win32/riched20/caret.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/caret.c?... ============================================================================== --- trunk/reactos/dll/win32/riched20/caret.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/caret.c [iso-8859-1] Mon Apr 6 17:53:46 2015 @@ -710,7 +710,7 @@ }
-static BOOL +BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) { ME_DisplayItem *pRun = cursor->pRun, *pOtherRun;
Modified: trunk/reactos/dll/win32/riched20/editor.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.c... ============================================================================== --- trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] Mon Apr 6 17:53:46 2015 @@ -3506,8 +3506,12 @@ 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);
Modified: trunk/reactos/dll/win32/riched20/editor.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.h... ============================================================================== --- trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] Mon Apr 6 17:53:46 2015 @@ -201,6 +201,7 @@ /* 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;