]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
RTF: If there is no background-color specified for a table-cell, then try to read...
authorPeter Herweg <pherweg@apache.org>
Tue, 27 Dec 2005 22:49:05 +0000 (22:49 +0000)
committerPeter Herweg <pherweg@apache.org>
Tue, 27 Dec 2005 22:49:05 +0000 (22:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@359308 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/rtf/TableAttributesConverter.java

index 68d1a687182b52355f92580e7d5a57a6cc576258..c82d31dc270d40c191fca8c02a904d38ca5810cb 100644 (file)
@@ -26,6 +26,7 @@ import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.flow.Table;
 import org.apache.fop.fo.flow.TableBody;
 import org.apache.fop.fo.flow.TableCell;
+import org.apache.fop.fo.flow.TableHeader;
 import org.apache.fop.fo.flow.TableRow;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.fo.properties.Property;
@@ -120,6 +121,21 @@ public class TableAttributesConverter {
 
         // Cell background color
         ColorType color = border.backgroundColor;
+        if (color == null) {
+            //If there is no background-color specified for the cell,
+            //then try to read it from table-row or table-header.
+            CommonBorderPaddingBackground brd = null;
+            
+            if (fobj.getParent() instanceof TableRow) {
+                TableRow parentRow=(TableRow)fobj.getParent();
+                brd = parentRow.getCommonBorderPaddingBackground();
+            } else if (fobj.getParent() instanceof TableHeader) {
+                TableHeader parentHeader=(TableHeader)fobj.getParent();
+                brd = parentHeader.getCommonBorderPaddingBackground();
+            }
+            
+            color = brd.backgroundColor;
+        }
         if ((color != null) 
                 && (color.getAlpha() != 0
                         || color.getRed() != 0