Module: wine Branch: master Commit: 8739f450cea348b4d68f44477c24609e81c34d3e URL: http://source.winehq.org/git/wine.git/?a=commit;h=8739f450cea348b4d68f44477c...
Author: Huw Davies huw@codeweavers.com Date: Tue Oct 11 13:04:00 2016 +0100
riched20: Don't emit paragraph props if they're the same as the previous paragraph's.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/riched20/writer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c index 0204215..27e07b1 100644 --- a/dlls/riched20/writer.c +++ b/dlls/riched20/writer.c @@ -429,6 +429,10 @@ ME_StreamOutRTFParaProps(ME_TextEditor *editor, ME_OutStream *pStream, PARAFORMAT2 *fmt = ¶->member.para.fmt; char props[STREAMOUT_BUFFER_SIZE] = ""; int i; + ME_Paragraph *prev_para = NULL; + + if (para->member.para.prev_para->type == diParagraph) + prev_para = ¶->member.para.prev_para->member.para;
if (!editor->bEmulateVersion10) { /* v4.1 */ if (para->member.para.nFlags & MEPF_ROWSTART) { @@ -462,7 +466,9 @@ ME_StreamOutRTFParaProps(ME_TextEditor *editor, ME_OutStream *pStream, } }
- /* TODO: Don't emit anything if the last PARAFORMAT2 is inherited */ + if (prev_para && !memcmp( fmt, &prev_para->fmt, sizeof(*fmt) )) + return TRUE; + if (!ME_StreamOutPrint(pStream, "\pard")) return FALSE;