]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #51007: RTF tables do not support percent column-widths.
authorGlenn Adams <gadams@apache.org>
Sun, 8 Apr 2012 00:25:34 +0000 (00:25 +0000)
committerGlenn Adams <gadams@apache.org>
Sun, 8 Apr 2012 00:25:34 +0000 (00:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310926 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java
status.xml

index 7e263340967e0af0a0510d21a3ce43eb0bff5756..270d7e24b7daaf88460ebb148960ac59f359a279 100644 (file)
@@ -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;
index a647cee7de024dc584425d4216d214cb855f82f6..cc9eeb2135920785c77ff9ac00847cb46c88c1a4 100644 (file)
@@ -62,6 +62,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Code" dev="GA" type="fix" fixes-bug="51007" due-to="Max Aster">
+        RTF tables do not support percent column-widths.
+      </action>
       <action context="Code" dev="GA" type="fix" fixes-bug="50435" due-to="Armin Haaf">
         Access denied (java.util.PropertyPermission org.apache.fop.fo.properties.use-cache read).
       </action>