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 pi...@apache.org on 2003/03/07 00:55:31 UTC

cvs commit: xml-fop/src/org/apache/fop/layout BodyAreaContainer.java

pietsch     2003/03/06 15:55:31

  Modified:    src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
                        Footnote.java
               src/org/apache/fop/fo/pagination Tag: fop-0_20_2-maintain
                        PageSequence.java
               src/org/apache/fop/layout Tag: fop-0_20_2-maintain
                        BodyAreaContainer.java
  Log:
  Implemented footnote separator.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.6   +21 -1     xml-fop/src/org/apache/fop/fo/flow/Footnote.java
  
  Index: Footnote.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Footnote.java,v
  retrieving revision 1.6.2.5
  retrieving revision 1.6.2.6
  diff -u -r1.6.2.5 -r1.6.2.6
  --- Footnote.java	25 Feb 2003 12:57:01 -0000	1.6.2.5
  +++ Footnote.java	6 Mar 2003 23:55:30 -0000	1.6.2.6
  @@ -129,6 +129,26 @@
                   footArea.setMaxHeight(bac.getMaxHeight()
                                         + footArea.getHeight());
               }
  +            if (!footArea.hasChildren()) {
  +                StaticContent separator = bac.getPage().getPageSequence()
  +                    .getStaticContent("xsl-footnote-separator");
  +                if (separator!=null) {
  +                    footArea.setIDReferences(bac.getIDReferences());
  +                    separator.layout(footArea, null);
  +                    int diff = footArea.getHeight() - oldHeight;
  +                    if (area != null) {
  +                        area.setMaxHeight(area.getMaxHeight() - diff);
  +                    }
  +                    if (bac.getFootnoteState() == 0) {
  +                        Area ar = bac.getMainReferenceArea();
  +                        decreaseMaxHeight(ar, diff);
  +                        footArea.setYPosition(basePos + footArea.getHeight());
  +                    }
  +                     basePos = footArea.getCurrentYPosition()
  +                               - footArea.getHeight();
  +                     oldHeight = footArea.getHeight();
  +                }
  +            }
               int status = fb.layout(footArea);
               if (Status.isIncomplete(status)) {
                   // add as a pending footnote
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.39.2.15 +9 -2      xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
  
  Index: PageSequence.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
  retrieving revision 1.39.2.14
  retrieving revision 1.39.2.15
  diff -u -r1.39.2.14 -r1.39.2.15
  --- PageSequence.java	6 Mar 2003 23:06:14 -0000	1.39.2.14
  +++ PageSequence.java	6 Mar 2003 23:55:30 -0000	1.39.2.15
  @@ -234,7 +234,10 @@
           if (flowMap.containsKey(staticContent.getFlowName())) {
               throw new FOPException("flow-names must be unique within an fo:page-sequence");
           }
  -        if (!this.layoutMasterSet.regionNameExists(staticContent.getFlowName())) {
  +        String flowName = staticContent.getFlowName();
  +        if (!this.layoutMasterSet.regionNameExists(flowName)
  +            && !flowName.equals("xsl-before-float-separator")
  +            && !flowName.equals("xsl-footnote-separator")) {
               log.error("region-name '"
                         + staticContent.getFlowName()
                         + "' doesn't exist in the layout-master-set.");
  @@ -480,6 +483,10 @@
   //                        + flow.getFlowName() + "'");
       }
   
  +    public StaticContent getStaticContent(String regionName) {
  +        return (StaticContent)flowMap.get(regionName);
  +    }
  +    
       public int getCurrentPageNumber() {
           return currentPageNumber; 
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.4  +7 -13     xml-fop/src/org/apache/fop/layout/Attic/BodyAreaContainer.java
  
  Index: BodyAreaContainer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Attic/BodyAreaContainer.java,v
  retrieving revision 1.10.2.3
  retrieving revision 1.10.2.4
  diff -u -r1.10.2.3 -r1.10.2.4
  --- BodyAreaContainer.java	25 Feb 2003 14:07:02 -0000	1.10.2.3
  +++ BodyAreaContainer.java	6 Mar 2003 23:55:31 -0000	1.10.2.4
  @@ -82,8 +82,6 @@
   
       // current heights
       private int mainRefAreaHeight;
  -    private int beforeFloatRefAreaHeight;
  -    private int footnoteRefAreaHeight;
   
       // reference area yPositions
       private int mainYPosition;
  @@ -109,13 +107,11 @@
           this.columnGap = columnGap;
   
           // create the primary reference areas
  -        beforeFloatRefAreaHeight = 0;
  -        footnoteRefAreaHeight = 0;
  -        mainRefAreaHeight = maxHeight - beforeFloatRefAreaHeight
  -                            - footnoteRefAreaHeight;
  +        mainRefAreaHeight = maxHeight;
           beforeFloatReferenceArea = new AreaContainer(fontState, xPosition,
  -                yPosition, allocationWidth, beforeFloatRefAreaHeight,
  -                Position.ABSOLUTE);
  +                                                     yPosition,
  +                                                     allocationWidth, 0,
  +                                                     Position.ABSOLUTE);
           beforeFloatReferenceArea.setAreaName("before-float-reference-area");
           this.addChild(beforeFloatReferenceArea);
           mainReferenceArea = new AreaContainer(fontState, xPosition,
  @@ -124,11 +120,9 @@
                                                 Position.ABSOLUTE);
           mainReferenceArea.setAreaName("main-reference-area");
           this.addChild(mainReferenceArea);
  -        int footnoteRefAreaYPosition = yPosition - mainRefAreaHeight;
           footnoteReferenceArea = new AreaContainer(fontState, xPosition,
  -                                                  footnoteRefAreaYPosition,
  -                                                  allocationWidth,
  -                                                  footnoteRefAreaHeight,
  +                                                  yPosition - mainRefAreaHeight,
  +                                                  allocationWidth, 0,
                                                     Position.ABSOLUTE);
           footnoteReferenceArea.setAreaName("footnote-reference-area");
           this.addChild(footnoteReferenceArea);
  
  
  

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