diff options
author | Glen Mazza <gmazza@apache.org> | 2005-03-01 00:11:03 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2005-03-01 00:11:03 +0000 |
commit | cf449e8e7cbe72b31df00eb9e4d66cc329ca891e (patch) | |
tree | 60967c5a441b6b58eaf5dcc4ae94f055c13e92c3 /src/java/org/apache/fop/fo | |
parent | 7cf4e8c524aeb09e97fe7bfeca8962a75e6efe69 (diff) | |
download | xmlgraphics-fop-cf449e8e7cbe72b31df00eb9e4d66cc329ca891e.tar.gz xmlgraphics-fop-cf449e8e7cbe72b31df00eb9e4d66cc329ca891e.zip |
Created new Root.notifyPageSequenceFinished() method, consolidating
two other methods to better stress that these occur as a unit.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198460 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/Root.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index 42e7bfdc5..ffe6ea971 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -159,14 +159,6 @@ public class Root extends FObj { } /** - * 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 @@ public class Root extends FObj { /** * 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."); - } + } } /** |