]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix for keep-together: parent LMs were not taken into account when determining...
authorJeremias Maerki <jeremias@apache.org>
Mon, 21 Mar 2005 12:41:34 +0000 (12:41 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 21 Mar 2005 12:41:34 +0000 (12:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198522 13f79535-47bb-0310-9956-ffa450edef68

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

index 31e4e512020d6df213f1e42b49e218e2e55ec194..a2ae001b18b5736be8457e5f665977129cfa6fae 100644 (file)
@@ -1210,7 +1210,8 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
      * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#mustKeepTogether()
      */
     public boolean mustKeepTogether() {
-        return !fobj.getKeepTogether().getWithinPage().isAuto();
+        return ((BlockLevelLayoutManager)getParent()).mustKeepTogether() 
+                || !fobj.getKeepTogether().getWithinPage().isAuto();
     }
 
     /**
index 34375c44a134155c4df6d6f45e9949cf96bce90f..914bb079d93cca8a9df59472268de5308d2cef34 100644 (file)
@@ -1060,7 +1060,8 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
      * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#mustKeepTogether()
      */
     public boolean mustKeepTogether() {
-        return !fobj.getKeepTogether().getWithinPage().isAuto();
+        return ((BlockLevelLayoutManager)getParent()).mustKeepTogether() 
+                || !fobj.getKeepTogether().getWithinPage().isAuto();
     }
 
     /**
index a55826f59258747a38faf2f2d10811cd1cf51e78..b197d9f44e19ccf18b7914ccaa4676201f51b582 100644 (file)
@@ -175,8 +175,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
         PageBreaker breaker = new PageBreaker(this);
         breaker.doLayout(flowBPD);
         
-        // TODO: Don't decrement currentPageNum when no pages are generated
-        currentPageNum--;
         finishPage();
         pageSeq.getRoot().notifyPageSequenceFinished(currentPageNum,
                 (currentPageNum - startPageNum) + 1);