import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontTriplet;
import org.apache.fop.layoutmgr.AbstractLayoutManager;
+import org.apache.fop.layoutmgr.BlockLevelEventProducer;
import org.apache.fop.layoutmgr.ElementListUtils;
import org.apache.fop.layoutmgr.InlineKnuthSequence;
import org.apache.fop.layoutmgr.KnuthPossPosIter;
private void determineBPD() {
LengthRangeProperty bpd = ((InlineContainer) fobj).getBlockProgressionDimension();
Property optimum = bpd.getOptimum(this); // TODO percent base context
+ int actualBPD = ElementListUtils.calcContentLength(childElements);
if (optimum.isAuto()) {
- contentAreaBPD = ElementListUtils.calcContentLength(childElements);
+ contentAreaBPD = actualBPD;
} else {
contentAreaBPD = optimum.getLength().getValue(this); // TODO percent base context
+ if (contentAreaBPD < actualBPD) {
+ BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
+ fobj.getUserAgent().getEventBroadcaster());
+ boolean canRecover = (((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW);
+ eventProducer.viewportBPDOverflow(this, fobj.getName(),
+ actualBPD - contentAreaBPD, needClip(), canRecover,
+ fobj.getLocator());
+ }
}
}
<fo:flow flow-name="xsl-region-body">
<fo:block-container space-before="10pt" start-indent="100pt" width="100pt">
<fo:block start-indent="0">
- Before: <fo:inline-container height="20pt">
+ Before: <fo:inline-container>
<fo:block>Inside the inline-container.</fo:block>
</fo:inline-container> After.
</fo:block>
</fo:inline-container> After.</fo:block>
</fo:flow>
</fo:page-sequence>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>Before: <fo:inline-container width="70pt" height="35pt" overflow="hidden">
+ <fo:block>This text overflows the inline-container in the
+ block-progression-direction.</fo:block>
+ </fo:inline-container> After.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
</fo:root>
</fo>
<checks>
- <eval expected="40000" xpath="//viewport/@bpd"/>
+ <eval expected="40000" xpath="//pageSequence[1]//viewport/@bpd"/>
+ <eval expected="35000" xpath="//pageSequence[2]//viewport/@bpd"/>
+ <true xpath="//pageSequence[2]//viewport/@clip"/>
</checks>
</testcase>