Commit 6072a69d authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Keep default char format on WM_SETFONT in plain text mode.

parent 4f2e15d0
......@@ -3502,16 +3502,18 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
CHARFORMAT2W fmt;
HDC hDC;
BOOL bRepaint = LOWORD(lParam);
ME_Cursor start;
if (!wParam)
wParam = (WPARAM)GetStockObject(SYSTEM_FONT);
wParam = (WPARAM)GetStockObject(SYSTEM_FONT);
GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf);
hDC = ITextHost_TxGetDC(editor->texthost);
ME_CharFormatFromLogFont(hDC, &lf, &fmt);
ME_CharFormatFromLogFont(hDC, &lf, &fmt);
ITextHost_TxReleaseDC(editor->texthost, hDC);
ME_SetCursorToStart(editor, &start);
ME_SetCharFormat(editor, &start, NULL, &fmt);
if (editor->mode & TM_RICHTEXT) {
ME_Cursor start;
ME_SetCursorToStart(editor, &start);
ME_SetCharFormat(editor, &start, NULL, &fmt);
}
ME_SetDefaultCharFormat(editor, &fmt);
ME_CommitUndo(editor);
......
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