diff options
author | Luis Bernardo <lbernardo@apache.org> | 2013-03-16 00:27:00 +0000 |
---|---|---|
committer | Luis Bernardo <lbernardo@apache.org> | 2013-03-16 00:27:00 +0000 |
commit | 1a57c79591d32f4a45ccf479836b033ed96b5541 (patch) | |
tree | 0e33cc4f6d50acdafe1bde17369dc56adf238518 /src | |
parent | 2008636c7e152009d9eefdd68caf04a2906808b5 (diff) | |
download | xmlgraphics-fop-1a57c79591d32f4a45ccf479836b033ed96b5541.tar.gz xmlgraphics-fop-1a57c79591d32f4a45ccf479836b033ed96b5541.zip |
FOP-2221: Make overflow messages easier to read and fix wrong/ missing messages; patch submitted by Simon Steiner.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1457180 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
5 files changed, 16 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index d20215151..78fd8893f 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -1040,6 +1040,9 @@ 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.xml b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml index d3e243a63..5431e3ec5 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml +++ b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml @@ -22,9 +22,9 @@ <message key="tableFixedAutoWidthNotSupported">table-layout="fixed" and width="auto", but auto-layout not supported => assuming width="100%".{{locator}}</message> <message key="objectTooWide">The extent in inline-progression-direction (width) of a {elementName} is bigger than the available space ({effIPD}mpt > {maxIPD}mpt).{{locator}}</message> <message key="overconstrainedAdjustEndIndent">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)</message> - <message key="viewportIPDOverflow">Content overflows the viewport of an {elementName} in inline-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message> - <message key="viewportBPDOverflow">Content overflows the viewport of an {elementName} in block-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message> - <message key="regionOverflow">Content overflows the viewport of the {elementName} on page {page} in block-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message> + <message key="viewportIPDOverflow">The contents of {elementName} exceed its 'width' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message> + <message key="viewportBPDOverflow">The contents of {elementName} exceed its 'height' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message> + <message key="regionOverflow">The contents of {elementName} on page {page} exceed its 'extent' value by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message> <message key="flowNotMappingToRegionBody">Flow "{flowName}" does not map to the region-body in page-master "{masterName}". FOP presently does not support this.{{locator}}</message> <message key="pageSequenceMasterExhausted">Subsequences exhausted in page-sequence-master "{pageSequenceMasterName}", {canRecover,if,using previous subsequence,cannot recover}.{{locator}}</message> <message key="missingSubsequencesInPageSequenceMaster">No subsequences in page-sequence-master "{pageSequenceMasterName}".{{locator}}</message> diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java index f286fbf6c..15284ae0a 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java @@ -59,11 +59,12 @@ public interface InlineLevelEventProducer extends EventProducer { /** * A line overflows. * @param source the event source + * @param elementName the formatting object * @param line the number number * @param overflowLength the length by which the content overflows the available space (in mpt) * @param loc the location of the error or null * @event.severity WARN */ - void lineOverflows(Object source, int line, int overflowLength, Locator loc); + void lineOverflows(Object source, String elementName, int line, int overflowLength, Locator loc); } diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml index 2e3ea6eb8..c7c6ee3d7 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml @@ -19,5 +19,5 @@ <catalogue xml:lang="en"> <message key="locator">[ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]</message> <message key="leaderWithoutContent">fo:leader is set to "use-content" but has no content.{{locator}}</message> - <message key="lineOverflows">Line {line} of a paragraph overflows the available area by {overflowLength,choice,50000#{overflowLength} millipoints|50000<more than 50 points}.{{locator}}</message> + <message key="lineOverflows">The contents of {elementName} line {line} exceeds the available area by {overflowLength,choice,50000#{overflowLength} millipoints|50000<more than 50 points}.{{locator}}</message> </catalogue> diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index a361d3415..6623b6319 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -397,8 +397,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager InlineLevelEventProducer eventProducer = InlineLevelEventProducer.Provider.get( getFObj().getUserAgent().getEventBroadcaster()); - eventProducer.lineOverflows(this, bestActiveNode.line, - -lack, getFObj().getLocator()); + if (curChildLM.getFObj() == null) { + eventProducer.lineOverflows(this, getFObj().getName(), bestActiveNode.line, + -lack, getFObj().getLocator()); + } else { + eventProducer.lineOverflows(this, curChildLM.getFObj().getName(), bestActiveNode.line, + -lack, curChildLM.getFObj().getLocator()); + } } } |