Commit 03f3a40a authored by Alex Villacís Lasso's avatar Alex Villacís Lasso Committed by Alexandre Julliard

riched20: EM_SETCHARFORMAT must fail and return 0 with TM_PLAINTEXT and SF_SELECTION.

parent 23804378
......@@ -1733,13 +1733,19 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
BOOL bRepaint = TRUE;
p = ME_ToCF2W(&buf, (CHARFORMAT2W *)lParam);
if (p == NULL) return 0;
if (!wParam || (editor->mode & TM_PLAINTEXT))
if (!wParam)
ME_SetDefaultCharFormat(editor, p);
else if (wParam == (SCF_WORD | SCF_SELECTION))
else if (wParam == (SCF_WORD | SCF_SELECTION)) {
FIXME("EM_SETCHARFORMAT: word selection not supported\n");
else if (wParam == SCF_ALL)
ME_SetCharFormat(editor, 0, ME_GetTextLength(editor), p);
else {
return 0;
} else if (wParam == SCF_ALL) {
if (editor->mode & TM_PLAINTEXT)
ME_SetDefaultCharFormat(editor, p);
else
ME_SetCharFormat(editor, 0, ME_GetTextLength(editor), p);
} else if (editor->mode & TM_PLAINTEXT) {
return 0;
} else {
int from, to;
ME_GetSelection(editor, &from, &to);
bRepaint = (from != to);
......
......@@ -572,9 +572,13 @@ static void test_TM_PLAINTEXT(void)
cf2.dwEffects = CFE_BOLD ^ cf2.dwEffects;
rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2);
todo_wine {
ok(rc == 0, "EM_SETCHARFORMAT returned %d instead of 0\n", rc);
}
ok(rc == 0, "EM_SETCHARFORMAT returned %d instead of 0\n", rc);
rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_WORD | SCF_SELECTION, (LPARAM) &cf2);
ok(rc == 0, "EM_SETCHARFORMAT returned %d instead of 0\n", rc);
rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM)&cf2);
ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc);
/*Get the formatting of those characters*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment