]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Make it possible to use percentages to specify Length values for flow and static...
authorKaren Lease <klease@apache.org>
Sun, 14 Oct 2001 20:39:54 +0000 (20:39 +0000)
committerKaren Lease <klease@apache.org>
Sun, 14 Oct 2001 20:39:54 +0000 (20:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194508 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/flow/Flow.java
src/org/apache/fop/fo/flow/StaticContent.java

index e2819fb1484549c94de60ac770b042f3bb82ea1e..9846c86d7f392c0267303707486ccd6cdfd68e48 100644 (file)
@@ -54,6 +54,11 @@ public class Flow extends FObj {
      */
     private String _flowName;
 
+    /**
+     * Content-width of current column area during layout
+     */
+    private int contentWidth;
+
     private Status _status = new Status(Status.AREA_FULL_NONE);
 
 
@@ -145,6 +150,8 @@ public class Flow extends FObj {
                 this.marker = i;
                 markerSnapshot = this.getMarkerSnapshot(new Vector());
             }
+           // Set current content width for percent-based lengths in children
+           setContentWidth(currentArea.getContentWidth());
 
             _status = fo.layout(currentArea);
 
@@ -200,15 +207,15 @@ public class Flow extends FObj {
         return _status;
     }
 
+    protected void setContentWidth(int contentWidth) {
+       this.contentWidth = contentWidth;
+    }
     /**
      * Return the content width of this flow (really of the region
      * in which it is flowing).
      */
     public int getContentWidth() {
-        if (area != null)
-            return area.getContentWidth();    // getAllocationWidth()??
-        else
-            return 0;                         // not laid out yet
+       return this.contentWidth;
     }
 
     protected String getElementName() {
index 35a388432b89c5268b2bcbcdd64993b531612c8c..9e50e242b41badc0b9e429b063d40468c80d7c84 100644 (file)
@@ -70,6 +70,7 @@ public class StaticContent extends Flow {
         } else if (regionClass.equals(RegionAfter.REGION_CLASS)) {
             area.setAbsoluteHeight(area.getPage().getBody().getMaxHeight());
         }
+       setContentWidth(area.getContentWidth());
 
         for (int i = 0; i < numChildren; i++) {
             FObj fo = (FObj)children.elementAt(i);