aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Reischenbacher <matthias@apache.org>2015-07-13 18:08:19 +0000
committerMatthias Reischenbacher <matthias@apache.org>2015-07-13 18:08:19 +0000
commitb7446dd31c308015a1414d375beb221d566169e9 (patch)
tree0fc80bbca38e8f87bce497f3eed44699ea41df96 /src
parent4cd8159bff58dc23916041a733523f5bd35e7ffb (diff)
downloadxmlgraphics-fop-b7446dd31c308015a1414d375beb221d566169e9.tar.gz
xmlgraphics-fop-b7446dd31c308015a1414d375beb221d566169e9.zip
FOP-2498: Fix "last" page master usage with force-page-count=end-on-even/-odd
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1690781 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
index 7d84a91ff..2e2bd0a22 100644
--- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
@@ -225,14 +225,22 @@ public class PageSequenceLayoutManager extends AbstractPageSequenceLayoutManager
protected int getForcedLastPageNum(final int lastPageNum) {
int forcedLastPageNum = lastPageNum;
int relativeLastPage = lastPageNum - startPageNum + 1;
- if (relativeLastPage % 2 != 0
- && (getPageSequence().getForcePageCount() == Constants.EN_EVEN
- || getPageSequence().getForcePageCount() == Constants.EN_END_ON_EVEN)) {
- forcedLastPageNum++;
- } else if (relativeLastPage % 2 == 0 && (
- getPageSequence().getForcePageCount() == Constants.EN_ODD
- || getPageSequence().getForcePageCount() == Constants.EN_END_ON_ODD)) {
- forcedLastPageNum++;
+ if (getPageSequence().getForcePageCount() == Constants.EN_EVEN) {
+ if (relativeLastPage % 2 != 0) {
+ forcedLastPageNum++;
+ }
+ } else if (getPageSequence().getForcePageCount() == Constants.EN_ODD) {
+ if (relativeLastPage % 2 == 0) {
+ forcedLastPageNum++;
+ }
+ } else if (getPageSequence().getForcePageCount() == Constants.EN_END_ON_EVEN) {
+ if (lastPageNum % 2 != 0) {
+ forcedLastPageNum++;
+ }
+ } else if (getPageSequence().getForcePageCount() == Constants.EN_END_ON_ODD) {
+ if (lastPageNum % 2 == 0) {
+ forcedLastPageNum++;
+ }
}
return forcedLastPageNum;
}