diff options
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index e63345f77..117893304 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -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())); } /** |