From 9060f22622165377e71876d5932ef89efc6ce2a2 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sun, 8 Apr 2012 00:25:34 +0000 Subject: [PATCH] Bugzilla #51007: RTF tables do not support percent column-widths. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310926 13f79535-47bb-0310-9956-ffa450edef68 --- .../rtf/rtflib/tools/PercentContext.java | 21 ++++++++++++++++--- status.xml | 3 +++ 2 files changed, 21 insertions(+), 3 deletions(-) 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 7e2633409..270d7e24b 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 @@ -66,12 +66,27 @@ public class PercentContext implements PercentBaseContext { Object width = lengthMap.get(fobj); if (width != null) { return Integer.parseInt(width.toString()); - } else { - return -1; + } else if (fobj.getParent() != null) { + // If the object itself has no width the parent width will be used + // because it is the base width of this object + width = lengthMap.get(fobj.getParent()); + if (width != null) { + return Integer.parseInt(width.toString()); + } } + return 0; case LengthBase.TABLE_UNITS: Object unit = tableUnitMap.get(fobj); - return (unit != null) ? ((Integer)unit).intValue() : 0; + if (unit != null) { + return ((Integer)unit).intValue(); + } else if (fobj.getParent() != null) { + // If the object itself has no width the parent width will be used + unit = tableUnitMap.get(fobj.getParent()); + if (unit != null) { + return ((Integer)unit).intValue(); + } + } + return 0; default: log.error(new Exception("Unsupported base type for LengthBase:" + lengthBase)); return 0; diff --git a/status.xml b/status.xml index a647cee7d..cc9eeb213 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 tables do not support percent column-widths. + Access denied (java.util.PropertyPermission org.apache.fop.fo.properties.use-cache read). -- 2.39.5