From 641a8093e23bccfecd5d73bb85c469c4d84a68da Mon Sep 17 00:00:00 2001 From: Luis Bernardo Date: Mon, 15 Apr 2013 21:43:05 +0000 Subject: [PATCH] FOP-2221: Make overflow messages easier to read and fix wrong/ missing messages; applied second patch by Simon Steiner. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1468239 13f79535-47bb-0310-9956-ffa450edef68 --- .../layoutmgr/BlockContainerLayoutManager.java | 3 --- .../fop/layoutmgr/BlockLevelEventProducer.java | 17 +++++++++++++++++ .../fop/layoutmgr/BlockLevelEventProducer.xml | 7 ++++--- .../layoutmgr/StaticContentLayoutManager.java | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 979868183..70ad376c0 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -1040,9 +1040,6 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager impl /** {@inheritDoc} */ public boolean handleOverflow(int milliPoints) { - if (width.getEnum() == EN_AUTO) { - return false; - } if (milliPoints > this.horizontalOverflow) { this.horizontalOverflow = milliPoints; } diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java index d9de09a46..387e5bbb9 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java @@ -131,6 +131,23 @@ public interface BlockLevelEventProducer extends EventProducer { int amount, boolean clip, boolean canRecover, Locator loc) throws LayoutException; + /** + * Contents overflow a static region viewport. + * @param source the event source + * @param elementName the formatting object + * @param page the page number/name where the overflow happened + * @param amount the amount by which the contents overflow (in mpt) + * @param clip true if the content will be clipped + * @param canRecover indicates whether FOP can recover from this problem and continue working + * @param loc the location of the error or null + * @throws LayoutException the layout error provoked by the method call + * @event.severity FATAL + */ + void staticRegionOverflow(Object source, String elementName, + String page, + int amount, boolean clip, boolean canRecover, + Locator loc) throws LayoutException; + /** * Indicates that FOP doesn't support flows that are not mapped to region-body, yet. * @param source the event source diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml index 5431e3ec5..477133ae1 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml +++ b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml @@ -22,9 +22,10 @@ table-layout="fixed" and width="auto", but auto-layout not supported => assuming width="100%".{{locator}} The extent in inline-progression-direction (width) of a {elementName} is bigger than the available space ({effIPD}mpt > {maxIPD}mpt).{{locator}} An {elementName} {{locator}} is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4) - The contents of {elementName} exceed its 'width' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} - The contents of {elementName} exceed its 'height' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} - The contents of {elementName} on page {page} exceed its 'extent' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} + Content overflows the viewport of an {elementName} in inline-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} + Content overflows the viewport of an {elementName} in block-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} + The contents of {elementName} on page {page} exceed its 'extent' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} + The contents of {elementName} on page {page} exceed its viewport by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}} Flow "{flowName}" does not map to the region-body in page-master "{masterName}". FOP presently does not support this.{{locator}} Subsequences exhausted in page-sequence-master "{pageSequenceMasterName}", {canRecover,if,using previous subsequence,cannot recover}.{{locator}} No subsequences in page-sequence-master "{pageSequenceMasterName}".{{locator}} diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index f7f563ea8..7caa31cfb 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -147,7 +147,7 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { boolean canRecover = (regionFO.getOverflow() != EN_ERROR_IF_OVERFLOW); boolean needClip = (regionFO.getOverflow() == Constants.EN_HIDDEN || regionFO.getOverflow() == Constants.EN_ERROR_IF_OVERFLOW); - eventProducer.regionOverflow(this, regionFO.getName(), + eventProducer.staticRegionOverflow(this, regionFO.getName(), page, breaker.getOverflowAmount(), needClip, canRecover, getStaticContentFO().getLocator()); -- 2.39.5