]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Allow for the case where a block-container occurs inside an inline
authorSimon Pepping <spepping@apache.org>
Tue, 3 Apr 2007 19:40:14 +0000 (19:40 +0000)
committerSimon Pepping <spepping@apache.org>
Tue, 3 Apr 2007 19:40:14 +0000 (19:40 +0000)
FO. This solves bug 42024.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@525253 13f79535-47bb-0310-9956-ffa450edef68

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

index e63345f771bb7ca072cca953c24e6d72cc28a654..11789330474973ba137cb893f102b27afbf16ef9 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.fop.area.Trait;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.flow.BlockContainer;
 import org.apache.fop.fo.properties.CommonAbsolutePosition;
+import org.apache.fop.layoutmgr.inline.InlineLayoutManager;
 import org.apache.fop.area.CTM;
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.datatypes.Length;
@@ -989,9 +990,12 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
      */
     public boolean mustKeepTogether() {
         //TODO Keeps will have to be more sophisticated sooner or later
-        return ((BlockLevelLayoutManager)getParent()).mustKeepTogether() 
-                || !getBlockContainerFO().getKeepTogether().getWithinPage().isAuto()
-                || !getBlockContainerFO().getKeepTogether().getWithinColumn().isAuto();
+        return (!getBlockContainerFO().getKeepTogether().getWithinPage().isAuto()
+                || !getBlockContainerFO().getKeepTogether().getWithinColumn().isAuto()
+                || (getParent() instanceof BlockLevelLayoutManager
+                    && ((BlockLevelLayoutManager) getParent()).mustKeepTogether())
+                || (getParent() instanceof InlineLayoutManager
+                    && ((InlineLayoutManager) getParent()).mustKeepTogether()));
     }
 
     /**