aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageBreaker.java3
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageProvider.java10
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java9
3 files changed, 21 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreaker.java b/src/java/org/apache/fop/layoutmgr/PageBreaker.java
index 309f4e32f..6a10fa22f 100644
--- a/src/java/org/apache/fop/layoutmgr/PageBreaker.java
+++ b/src/java/org/apache/fop/layoutmgr/PageBreaker.java
@@ -298,7 +298,8 @@ public class PageBreaker extends AbstractBreaker {
return;
}
- boolean lastPageMasterDefined = pslm.getPageSequence().hasPagePositionLast();
+ boolean lastPageMasterDefined = pslm.getPageSequence().hasPagePositionLast()
+ || pslm.getPageSequence().hasPagePositionOnly() && pslm.isOnFirstPage(partCount - 1);
if (!hasMoreContent()) {
//last part is reached
if (lastPageMasterDefined) {
diff --git a/src/java/org/apache/fop/layoutmgr/PageProvider.java b/src/java/org/apache/fop/layoutmgr/PageProvider.java
index 8117d547d..1cb6251d9 100644
--- a/src/java/org/apache/fop/layoutmgr/PageProvider.java
+++ b/src/java/org/apache/fop/layoutmgr/PageProvider.java
@@ -339,4 +339,14 @@ public class PageProvider implements Constants {
return page;
}
+ /**
+ * Indicates whether the column/page at the given index is on the first page of the page sequence.
+ *
+ * @return {@code true} if the given part is on the first page of the sequence
+ */
+ boolean isOnFirstPage(int partIndex) {
+ Column column = getColumn(partIndex);
+ return startPageOfCurrentElementList + column.pageIndex == startPageOfPageSequence;
+ }
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
index 577f172eb..b5e21aa63 100644
--- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
@@ -210,4 +210,13 @@ public class PageSequenceLayoutManager extends AbstractPageSequenceLayoutManager
return forcedLastPageNum;
}
+ /**
+ * Indicates whether the column/page at the given index is on the first page of this page sequence.
+ *
+ * @return {@code true} if the given part is on the first page of the sequence
+ */
+ boolean isOnFirstPage(int partIndex) {
+ return pageProvider.isOnFirstPage(partIndex);
+ }
+
}