From 1a9d1d9ad0d90e26df6e399a4ecf7a2b1a93d78f Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sun, 8 Apr 2012 20:18:15 +0000 Subject: [PATCH] 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 --- .../fop/render/rtf/rtflib/tools/PercentContext.java | 8 ++++++++ status.xml | 3 +++ 2 files changed, 11 insertions(+) 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: diff --git a/status.xml b/status.xml index 8b09facf5..d9e1d7680 100644 --- a/status.xml +++ b/status.xml @@ -62,6 +62,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + RTF percentage table column width not calculated from table. + RTF generates unexpected lines for blocks in tables. Also fix three findbugs issues. -- 2.39.5