Module: wine Branch: master Commit: a06dcd46bb87bc84552e23ce997c3b8eef969363 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a06dcd46bb87bc84552e23ce99...
Author: Huw Davies huw@codeweavers.com Date: Tue Oct 11 13:04:04 2016 +0100
riched20: Move the check for cell border colours into the same loop as the other colours.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/riched20/writer.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c index e79aacf..fe8c797 100644 --- a/dlls/riched20/writer.c +++ b/dlls/riched20/writer.c @@ -259,8 +259,8 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ME_DisplayItem *item = pFirstRun; ME_FontTableItem *table = pStream->fonttbl; unsigned int i; - ME_DisplayItem *pLastPara = ME_GetParagraph(pLastRun); ME_DisplayItem *pCell = NULL; + ME_Paragraph *prev_para = NULL;
do { CHARFORMAT2W *fmt = &item->member.run.style->fmt; @@ -272,14 +272,10 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, if (fmt->dwMask & CFM_BACKCOLOR && !(fmt->dwEffects & CFE_AUTOBACKCOLOR)) add_color_to_colortbl( pStream, fmt->crBackColor );
- if (item == pLastRun) - break; - item = ME_FindItemFwd(item, diRun); - } while (item); - item = ME_GetParagraph(pFirstRun); - do { - if ((pCell = item->member.para.pCell)) + if (item->member.run.para != prev_para) { + if ((pCell = item->member.para.pCell)) + { ME_Border* borders[4] = { &pCell->member.cell.border.top, &pCell->member.cell.border.left, &pCell->member.cell.border.bottom, @@ -287,12 +283,16 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, for (i = 0; i < 4; i++) if (borders[i]->width > 0) add_color_to_colortbl( pStream, borders[i]->colorRef ); + } + + prev_para = item->member.run.para; } - if (item == pLastPara) + + if (item == pLastRun) break; - item = item->member.para.next_para; + item = ME_FindItemFwd(item, diRun); } while (item); - + if (!ME_StreamOutPrint(pStream, "{\fonttbl")) return FALSE;