From: Simon Pepping Date: Tue, 3 Apr 2007 19:40:14 +0000 (+0000) Subject: Allow for the case where a block-container occurs inside an inline X-Git-Tag: fop-0_94~146 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=894074229cae709ed7cd6d178e5966b46be72f64;p=xmlgraphics-fop.git Allow for the case where a block-container occurs inside an inline FO. This solves bug 42024. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@525253 13f79535-47bb-0310-9956-ffa450edef68 --- 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())); } /**