You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ga...@apache.org on 2012/04/08 02:25:34 UTC

svn commit: r1310926 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java status.xml

Author: gadams
Date: Sun Apr  8 00:25:34 2012
New Revision: 1310926

URL: http://svn.apache.org/viewvc?rev=1310926&view=rev
Log:
Bugzilla #51007: RTF tables do not support percent column-widths.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java?rev=1310926&r1=1310925&r2=1310926&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java Sun Apr  8 00:25:34 2012
@@ -66,12 +66,27 @@ public class PercentContext implements P
             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;

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1310926&r1=1310925&r2=1310926&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Sun Apr  8 00:25:34 2012
@@ -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>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org