riched20: Accept RTF group tokens inside colortbl destination

Phil Krylov phil at newstar.rinet.ru
Thu Aug 10 14:08:17 CDT 2006


Hi,

this patch is related to bug 5796 and fixes the colors in the displayed text.

-- Ph.
-------------- next part --------------
From nobody Mon Sep 17 00:00:00 2001
From: Phil Krylov <phil at newstar.rinet.ru>
Date: Thu Aug 10 23:04:32 2006 +0400
Subject: [PATCH] riched20: Accept RTF group markers inside colortbl destination

---

 dlls/riched20/reader.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

eae06aba03ab0572bdbc11ee60b45613fbbfc50a
diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c
index 856cd8a..e6e4186 100644
--- a/dlls/riched20/reader.c
+++ b/dlls/riched20/reader.c
@@ -1057,6 +1057,7 @@ static void ReadColorTbl(RTF_Info *info)
 	RTFColor	*cp;
 	int		cnum = 0;
 	const char	*fn = "ReadColorTbl";
+        int group_level = 1;
 
 	TRACE("\n");
 
@@ -1066,7 +1067,18 @@ static void ReadColorTbl(RTF_Info *info)
 		if (info->rtfClass == rtfEOF)
 			break;
 		if (RTFCheckCM (info, rtfGroup, rtfEndGroup))
-			break;
+                {
+                        group_level--;
+                        if (!group_level)
+                                break;
+                        continue;
+                }
+                else if (RTFCheckCM(info, rtfGroup, rtfBeginGroup))
+                {
+                        group_level++;
+                        continue;
+                }
+                
 		cp = New (RTFColor);
 		if (cp == NULL)
 			ERR ( "%s: cannot allocate color entry\n", fn);
-- 
1.2.4


More information about the wine-patches mailing list