]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed a bug in markers with boundary document and page-sequence.
authorJeremias Maerki <jeremias@apache.org>
Thu, 27 Jan 2005 20:31:27 +0000 (20:31 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 27 Jan 2005 20:31:27 +0000 (20:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198329 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java

index e550962e4baf306f689b0a0013a06fd7498a00cf..41e0b3b3b5f39d787f94ffd473d61726c90f40fc 100644 (file)
@@ -388,14 +388,18 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
             boolean doc = boundary == EN_DOCUMENT;
             int seq = areaTreeModel.getPageSequenceCount();
             int page = areaTreeModel.getPageCount(seq) - 1;
+            while (page < 0 && doc && seq > 1) {
+                seq--;
+                page = areaTreeModel.getPageCount(seq) - 1;
+            }
             while (page >= 0) {
                 PageViewport pv = areaTreeModel.getPage(seq, page);
-                mark = (Marker)curPage.getMarker(name, pos);
+                mark = (Marker)pv.getMarker(name, pos);
                 if (mark != null) {
                     return mark;
                 }
                 page--;
-                if (page == -1 && doc && seq > 0) {
+                if (page < 0 && doc && seq > 1) {
                     seq--;
                     page = areaTreeModel.getPageCount(seq) - 1;
                 }