From 2019ec38dbee432d56a7648545992d3a34741cbf Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 11 Oct 2016 13:03:59 +0100 Subject: [PATCH] riched20: The new eop style when typing a list is a copy of the existing eop style. Normally the new eop style is the insert style, however in a list the existing eop style is used. This prevents the list label style from changing when the new eop is inserted. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/riched20/editor.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 162daa82113..8b94ccf4fac 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2404,7 +2404,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) int from, to; const WCHAR endl = '\r'; const WCHAR endlv10[] = {'\r','\n'}; - ME_Style *style; + ME_Style *style, *eop_style; if (editor->styleFlags & ES_READONLY) { MessageBeep(MB_ICONERROR); @@ -2501,14 +2501,22 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) } style = ME_GetInsertStyle(editor, 0); + + /* Normally the new eop style is the insert style, however in a list it is copied from the existing + eop style (this prevents the list label style changing when the new eop is inserted). + No extra ref is taken here on eop_style. */ + if (para->member.para.fmt.wNumbering) + eop_style = para->member.para.eop_run->style; + else + eop_style = style; ME_ContinueCoalescingTransaction(editor); if (shift_is_down) ME_InsertEndRowFromCursor(editor, 0); else if (!editor->bEmulateVersion10) - ME_InsertTextFromCursor(editor, 0, &endl, 1, style); + ME_InsertTextFromCursor(editor, 0, &endl, 1, eop_style); else - ME_InsertTextFromCursor(editor, 0, endlv10, 2, style); + ME_InsertTextFromCursor(editor, 0, endlv10, 2, eop_style); ME_CommitCoalescingUndo(editor); SetCursor(NULL);