]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Partial fix to break handling
authorLuca Furini <lfurini@apache.org>
Tue, 26 Apr 2005 16:39:12 +0000 (16:39 +0000)
committerLuca Furini <lfurini@apache.org>
Tue, 26 Apr 2005 16:39:12 +0000 (16:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198594 13f79535-47bb-0310-9956-ffa450edef68

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

index 8046331fb446e0d26991be2631473fafbac10a2a..2406fce7fbbca05a83cd1608b3c91b8ab0144cdc 100644 (file)
@@ -96,7 +96,7 @@ public abstract class AbstractBreaker {
         return (blockLists.size() == 0);
     }
     
-    protected void startPart(BlockSequence list) {
+    protected void startPart(BlockSequence list, int localPageNumber) {
         //nop
     }
     
@@ -202,7 +202,7 @@ public abstract class AbstractBreaker {
             System.out.println("PLM> part: " + (p + 1)
                     + ", break at position " + endElementIndex);
 
-            startPart(effectiveList);
+            startPart(effectiveList, p+1);
             
             int displayAlign = getCurrentDisplayAlign();
             
index 1fe9c4ae0c9d09db08c6f3778156b9de9268a9c0..46a83e0b5b3ecef8fc7af3553972ed373d25b256 100644 (file)
@@ -193,7 +193,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
             addAreas(alg, partCount, originalList, effectiveList);
         }
         
-        protected void startPart(BlockSequence list) {
+        protected void startPart(BlockSequence list, int localPageNumber) {
             if (curPage == null) {
                 throw new IllegalStateException("curPage must not be null");
             } else {
@@ -203,8 +203,16 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
                 if (!firstPart) {
                     if (curFlowIdx < curPage.getCurrentSpan().getColumnCount()-1) {
                         curFlowIdx++;
-                    } else {
+                    } else if (localPageNumber == 1) {
+                        // this is the first page that will be created by
+                        // the current BlockSequence: it could have a break
+                        // condition that must be satisfied
                         handleBreak(list.getStartOn());
+                    } else {
+                        // this is NOT the first page that will be created by
+                        // the current BlockSequence: we simply need a new
+                        // page
+                        handleBreak(Constants.EN_PAGE);
                     }
                 }
             }