aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Herweg <pherweg@apache.org>2005-12-27 22:49:05 +0000
committerPeter Herweg <pherweg@apache.org>2005-12-27 22:49:05 +0000
commit9c2840ebeb812fa66d1c1318d0e74bc2f970506d (patch)
treec9db78ca84f2e60a0bfda42994ded6270a6e6333
parent3742f324a30750df6a6c69397d2501c82576ba7c (diff)
downloadxmlgraphics-fop-9c2840ebeb812fa66d1c1318d0e74bc2f970506d.tar.gz
xmlgraphics-fop-9c2840ebeb812fa66d1c1318d0e74bc2f970506d.zip
RTF: If there is no background-color specified for a table-cell, then try to read it from table-row or table-header.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@359308 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/render/rtf/TableAttributesConverter.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index 68d1a6871..c82d31dc2 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -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