return endingPageNumberOfPreviousSequence;
}
- /**
- * 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
/**
* 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.");
- }
+ }
}
/**
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() */