riched20: Always write out the color table.

This commit is contained in:
Huw Davies 2013-03-25 11:05:56 +00:00 committed by Alexandre Julliard
parent c409fc13fd
commit a20d42de15

View file

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