Module: wine
Branch: master
Commit: 2019ec38dbee432d56a7648545992d3a34741cbf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2019ec38dbee432d56a764854…
Author: Huw Davies <huw(a)codeweavers.com>
Date: Tue Oct 11 13:03:59 2016 +0100
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 <huw(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
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 162daa8..8b94ccf 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);