aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2005-03-01 00:11:03 +0000
committerGlen Mazza <gmazza@apache.org>2005-03-01 00:11:03 +0000
commitcf449e8e7cbe72b31df00eb9e4d66cc329ca891e (patch)
tree60967c5a441b6b58eaf5dcc4ae94f055c13e92c3
parent7cf4e8c524aeb09e97fe7bfeca8962a75e6efe69 (diff)
downloadxmlgraphics-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
-rw-r--r--src/java/org/apache/fop/fo/pagination/Root.java17
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java3
2 files changed, 7 insertions, 13 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.");
- }
+ }
}
/**
diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
index a571ffa86..d7cb07fa3 100644
--- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
@@ -212,8 +212,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
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() */