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 gm...@apache.org on 2005/03/01 01:11:04 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination Root.java

gmazza      2005/02/28 16:11:04

  Modified:    src/java/org/apache/fop/layoutmgr
                        PageSequenceLayoutManager.java
               src/java/org/apache/fop/fo/pagination Root.java
  Log:
  Created new Root.notifyPageSequenceFinished() method, consolidating
  two other methods to better stress that these occur as a unit.
  
  Revision  Changes    Path
  1.38      +2 -3      xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
  
  Index: PageSequenceLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- PageSequenceLayoutManager.java	20 Feb 2005 19:50:47 -0000	1.37
  +++ PageSequenceLayoutManager.java	1 Mar 2005 00:11:03 -0000	1.38
  @@ -212,8 +212,7 @@
           currentPageNum--;
           log.debug("Ending layout");
           finishPage();
  -        pageSeq.getRoot().notifyAdditionalPagesGenerated((currentPageNum - startPageNum) + 1);
  -        pageSeq.getRoot().setEndingPageNumberOfPreviousSequence(currentPageNum);
  +        pageSeq.getRoot().notifyPageSequenceFinished(currentPageNum, (currentPageNum - startPageNum) + 1);
       }
   
       /** @see org.apache.fop.layoutmgr.LayoutManager#isBogus() */
  
  
  
  1.41      +6 -11     xml-fop/src/java/org/apache/fop/fo/pagination/Root.java
  
  Index: Root.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Root.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Root.java	18 Feb 2005 03:54:50 -0000	1.40
  +++ Root.java	1 Mar 2005 00:11:03 -0000	1.41
  @@ -159,14 +159,6 @@
       }
   
       /**
  -     * Sets the last page number by the just-finished page-sequence
  -     * @param lastPageNumber the last page number of the sequence
  -     */
  -    public void setEndingPageNumberOfPreviousSequence(int lastPageNumber) {
  -        endingPageNumberOfPreviousSequence = lastPageNumber;
  -    }
  -
  -    /**
        * Returns the total number of pages generated by FOP
        * (May not equal endingPageNumberOfPreviousSequence due to
        * initial-page-number property on fo:page-sequences.)
  @@ -178,16 +170,19 @@
   
       /**
        * Notify additional pages generated to increase the totalPagesGenerated counter
  -     * @param lastPageNumber the last page number of the sequence
  +     * @param lastPageNumber the last page number generated by the sequence
  +     * @param additionalPages the total pages generated by the sequence (for statistics)
        * @throws IllegalArgumentException for negative additional page counts
        */
  -    public void notifyAdditionalPagesGenerated(int additionalPages) {
  +    public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) {    
  +        
           if (additionalPages >= 0) {
               totalPagesGenerated += additionalPages;
  +            endingPageNumberOfPreviousSequence = lastPageNumber;           
           } else {
               throw new IllegalArgumentException(
                   "Number of additional pages must be zero or greater.");
  -        }
  +        }       
       }
   
       /**
  
  
  

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