aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java12
-rw-r--r--test/layoutengine/standard-testcases/inline-container_auto-ipd.xml2
-rw-r--r--test/layoutengine/standard-testcases/inline-container_bpd.xml12
3 files changed, 23 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
index 107461c0a..152d16a3d 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
@@ -35,6 +35,7 @@ import org.apache.fop.fonts.Font;
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;
@@ -106,10 +107,19 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
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());
+ }
}
}
diff --git a/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml b/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml
index 48f5cd1cf..0833d7f0d 100644
--- a/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml
+++ b/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml
@@ -42,7 +42,7 @@
<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>
diff --git a/test/layoutengine/standard-testcases/inline-container_bpd.xml b/test/layoutengine/standard-testcases/inline-container_bpd.xml
index 0a9d87442..bd2dfdf9e 100644
--- a/test/layoutengine/standard-testcases/inline-container_bpd.xml
+++ b/test/layoutengine/standard-testcases/inline-container_bpd.xml
@@ -37,10 +37,20 @@
</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>