From 9c2840ebeb812fa66d1c1318d0e74bc2f970506d Mon Sep 17 00:00:00 2001 From: Peter Herweg Date: Tue, 27 Dec 2005 22:49:05 +0000 Subject: [PATCH] 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 --- .../fop/render/rtf/TableAttributesConverter.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.39.5