gmazza      2003/11/11 05:50:00

  Modified:    src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
  Log:
  Partial implementation of space-after functionality--mostly working, but
  some remaining problems:
  
  1.) relying on a static variable to carry space-after value from previous
  block to current.  (BlockLayoutManager is be instantiated for each block
  instead of being in memory for all blocks--bad design?)
  
  2.) The space-after of a block ending at the bottom of the page is not
  currently being added to the beginning of the subsequent page.
  
  Revision  Changes    Path
  1.9       +12 -3     
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BlockLayoutManager.java   11 Nov 2003 04:40:12 -0000      1.8
  +++ BlockLayoutManager.java   11 Nov 2003 13:50:00 -0000      1.9
  @@ -85,7 +85,9 @@
          used in rendering the fo:block.
       */
       private MinOptMax foBlockSpaceBefore = null;
  -    private MinOptMax foBlockSpaceAfter = null;  // not currently implemented
  +    // need to retain foBlockSpaceAfter from previous instantiation
  +    private static MinOptMax foBlockSpaceAfter = null;
  +    private MinOptMax prevFoBlockSpaceAfter = null;
   
       private int lead = 12000;
       private int lineHeight = 14000;
  @@ -181,6 +183,7 @@
           borderProps = pm.getBorderAndPadding();
           backgroundProps = pm.getBackgroundProps();
           foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
  +        prevFoBlockSpaceAfter = foBlockSpaceAfter;
       }
   
       public BreakPoss getNextBreakPoss(LayoutContext context) {
  @@ -190,9 +193,14 @@
   
           MinOptMax stackSize = new MinOptMax();
   
  +        if (prevFoBlockSpaceAfter != null) {
  +            stackSize.add(prevFoBlockSpaceAfter);
  +            prevFoBlockSpaceAfter = null;
  +        }
  +
           if (foBlockSpaceBefore != null) {
               // this function called before addAreas(), so
  -            // setting foBlockSpaceBefore = null *in* addAreas()
  +            // resetting foBlockSpaceBefore = null in addAreas()
               stackSize.add(foBlockSpaceBefore);
           }
           
  @@ -308,7 +316,8 @@
           flush();
   
           // if adjusted space after
  -        addBlockSpacing(adjust, layoutProps.spaceAfter.getSpace());
  +        foBlockSpaceAfter = layoutProps.spaceAfter.getSpace();
  +        addBlockSpacing(adjust, foBlockSpaceAfter);
   
           curBlockArea = null;
       }
  
  
  

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

Reply via email to