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

riched20: Always write out the color table.

parent c409fc13
......@@ -297,20 +297,15 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
if (!ME_StreamOutPrint(pStream, "}\r\n"))
return FALSE;
/* Output colors table if not empty */
if (pStream->nColorTblLen > 1) {
if (!ME_StreamOutPrint(pStream, "{\\colortbl;"))
return FALSE;
for (i = 1; i < pStream->nColorTblLen; i++) {
if (!ME_StreamOutPrint(pStream, "\\red%u\\green%u\\blue%u;",
pStream->colortbl[i] & 0xFF,
(pStream->colortbl[i] >> 8) & 0xFF,
(pStream->colortbl[i] >> 16) & 0xFF))
return FALSE;
}
if (!ME_StreamOutPrint(pStream, "}"))
/* Output the color table */
if (!ME_StreamOutPrint(pStream, "{\\colortbl;")) return FALSE; /* first entry is auto-color */
for (i = 1; i < pStream->nColorTblLen; i++)
{
if (!ME_StreamOutPrint(pStream, "\\red%u\\green%u\\blue%u;", pStream->colortbl[i] & 0xFF,
(pStream->colortbl[i] >> 8) & 0xFF, (pStream->colortbl[i] >> 16) & 0xFF))
return FALSE;
}
if (!ME_StreamOutPrint(pStream, "}")) return FALSE;
return TRUE;
}
......
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