Commit a06dcd46 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Move the check for cell border colours into the same loop as the other colours.

parent b8e55779
...@@ -259,8 +259,8 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ...@@ -259,8 +259,8 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
ME_DisplayItem *item = pFirstRun; ME_DisplayItem *item = pFirstRun;
ME_FontTableItem *table = pStream->fonttbl; ME_FontTableItem *table = pStream->fonttbl;
unsigned int i; unsigned int i;
ME_DisplayItem *pLastPara = ME_GetParagraph(pLastRun);
ME_DisplayItem *pCell = NULL; ME_DisplayItem *pCell = NULL;
ME_Paragraph *prev_para = NULL;
do { do {
CHARFORMAT2W *fmt = &item->member.run.style->fmt; CHARFORMAT2W *fmt = &item->member.run.style->fmt;
...@@ -272,12 +272,8 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ...@@ -272,12 +272,8 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
if (fmt->dwMask & CFM_BACKCOLOR && !(fmt->dwEffects & CFE_AUTOBACKCOLOR)) if (fmt->dwMask & CFM_BACKCOLOR && !(fmt->dwEffects & CFE_AUTOBACKCOLOR))
add_color_to_colortbl( pStream, fmt->crBackColor ); add_color_to_colortbl( pStream, fmt->crBackColor );
if (item == pLastRun) if (item->member.run.para != prev_para)
break; {
item = ME_FindItemFwd(item, diRun);
} while (item);
item = ME_GetParagraph(pFirstRun);
do {
if ((pCell = item->member.para.pCell)) if ((pCell = item->member.para.pCell))
{ {
ME_Border* borders[4] = { &pCell->member.cell.border.top, ME_Border* borders[4] = { &pCell->member.cell.border.top,
...@@ -288,9 +284,13 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ...@@ -288,9 +284,13 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
if (borders[i]->width > 0) if (borders[i]->width > 0)
add_color_to_colortbl( pStream, borders[i]->colorRef ); add_color_to_colortbl( pStream, borders[i]->colorRef );
} }
if (item == pLastPara)
prev_para = item->member.run.para;
}
if (item == pLastRun)
break; break;
item = item->member.para.next_para; item = ME_FindItemFwd(item, diRun);
} while (item); } while (item);
if (!ME_StreamOutPrint(pStream, "{\\fonttbl")) if (!ME_StreamOutPrint(pStream, "{\\fonttbl"))
......
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