Skip to content

Commit 5cc5501

Browse files
committed
[RICHED20] Handle SCF_WORD. By Christoph von Wittich. Already accepted upstream.
svn path=/trunk/; revision=67075
1 parent be34509 commit 5cc5501

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

reactos/dll/win32/riched20/caret.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
710710
}
711711

712712

713-
static BOOL
713+
BOOL
714714
ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
715715
{
716716
ME_DisplayItem *pRun = cursor->pRun, *pOtherRun;

reactos/dll/win32/riched20/editor.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,8 +3506,12 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
35063506
if (editor->mode & TM_PLAINTEXT)
35073507
return 0;
35083508
if (wParam & SCF_WORD) {
3509-
FIXME("EM_SETCHARFORMAT: word selection not supported\n");
3510-
return 0;
3509+
ME_Cursor start;
3510+
ME_Cursor end = editor->pCursors[0];
3511+
ME_MoveCursorWords(editor, &end, +1);
3512+
start = end;
3513+
ME_MoveCursorWords(editor, &start, -1);
3514+
ME_SetCharFormat(editor, &start, &end, p);
35113515
}
35123516
bRepaint = ME_IsSelection(editor);
35133517
ME_SetSelectionCharFormat(editor, p);

reactos/dll/win32/riched20/editor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) DECLSPEC_
201201
/* caret.c */
202202
void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN;
203203
int ME_SetSelection(ME_TextEditor *editor, int from, int to) DECLSPEC_HIDDEN;
204+
BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) DECLSPEC_HIDDEN;
204205
void ME_HideCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;
205206
void ME_ShowCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;
206207
void ME_MoveCaret(ME_TextEditor *ed) DECLSPEC_HIDDEN;

0 commit comments

Comments
 (0)