klease      01/10/14 13:39:54

  Modified:    src/org/apache/fop/fo/flow Flow.java StaticContent.java
  Log:
  Make it possible to use percentages to specify Length values for flow and 
static-content children
  
  Revision  Changes    Path
  1.24      +12 -5     xml-fop/src/org/apache/fop/fo/flow/Flow.java
  
  Index: Flow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Flow.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Flow.java 2001/09/11 10:04:24     1.23
  +++ Flow.java 2001/10/14 20:39:54     1.24
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Flow.java,v 1.23 2001/09/11 10:04:24 keiron Exp $
  + * $Id: Flow.java,v 1.24 2001/10/14 20:39:54 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -54,6 +54,11 @@
        */
       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 @@
                   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 @@
           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() {
  
  
  
  1.18      +2 -1      xml-fop/src/org/apache/fop/fo/flow/StaticContent.java
  
  Index: StaticContent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/StaticContent.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- StaticContent.java        2001/09/25 12:46:19     1.17
  +++ StaticContent.java        2001/10/14 20:39:54     1.18
  @@ -1,5 +1,5 @@
   /*
  - * $Id: StaticContent.java,v 1.17 2001/09/25 12:46:19 keiron Exp $
  + * $Id: StaticContent.java,v 1.18 2001/10/14 20:39:54 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -70,6 +70,7 @@
           } 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);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to