Huw Davies : riched20: Always write out the color table.
Alexandre Julliard
julliard at winehq.org
Mon Mar 25 14:19:39 CDT 2013
Module: wine
Branch: master
Commit: a20d42de1565caf43b5693c6d455c9373a34029b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a20d42de1565caf43b5693c6d455c9373a34029b
Author: Huw Davies <huw at codeweavers.com>
Date: Mon Mar 25 11:05:56 2013 +0000
riched20: Always write out the color table.
---
dlls/riched20/writer.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c
index cd2362e..440cb1b 100644
--- a/dlls/riched20/writer.c
+++ b/dlls/riched20/writer.c
@@ -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;
}
More information about the wine-cvs
mailing list