From 1a9d1d9ad0d90e26df6e399a4ecf7a2b1a93d78f Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sun, 8 Apr 2012 20:18:15 +0000 Subject: Bugzilla #50901: RTF percentage table column width not calculated from table. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1311081 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/rtf/rtflib/tools/PercentContext.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/java/org/apache/fop/render/rtf/rtflib') diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java index 270d7e24b..643757b71 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java @@ -29,6 +29,7 @@ import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.table.Table; +import org.apache.fop.fo.flow.table.TableColumn; import org.apache.fop.fo.pagination.PageSequence; /** @@ -59,6 +60,13 @@ public class PercentContext implements PercentBaseContext { if (fobj == null) { return 0; } + + // Special handler for TableColumn width specifications, needs to be + // relative to the parent! + if ( ( fobj instanceof TableColumn ) && ( fobj.getParent() instanceof FObj ) ) { + fobj = (FObj) fobj.getParent(); + } + switch (lengthBase) { case LengthBase.CONTAINING_BLOCK_WIDTH: case LengthBase.PARENT_AREA_WIDTH: -- cgit v1.2.3