aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2013-10-24 16:26:26 +0000
committerVincent Hennebert <vhennebert@apache.org>2013-10-24 16:26:26 +0000
commit5530937d762b0a15b48940c544a157769b1137a0 (patch)
treee4819917e9aefffed28b7b1646a686fa33572550 /src/java/org
parentc925990c7c290876d6857a4cc02e362b0ed6ca72 (diff)
downloadxmlgraphics-fop-5530937d762b0a15b48940c544a157769b1137a0.tar.gz
xmlgraphics-fop-5530937d762b0a15b48940c544a157769b1137a0.zip
Issue a warning if the content of an inline-container overflows it in the block-progression-direction
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_InlineContainer@1535430 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java12
1 files changed, 11 insertions, 1 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());
+ }
}
}