diff options
author | Jeremias Maerki <jeremias@apache.org> | 2007-11-13 13:07:33 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2007-11-13 13:07:33 +0000 |
commit | 1f979bbef4b413b37c8b8181260d4154f983cd1c (patch) | |
tree | cae107be0ec15c50c4d6130638020f960bcca012 /src/java/org/apache/fop/layoutmgr/inline | |
parent | 28920ff55494e247e4296699e85511e581895f03 (diff) | |
download | xmlgraphics-fop-1f979bbef4b413b37c8b8181260d4154f983cd1c.tar.gz xmlgraphics-fop-1f979bbef4b413b37c8b8181260d4154f983cd1c.zip |
More informative overflow message (sometimes the overflow is just a few millipoints and it's nice to know how many).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@594522 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/inline')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index d6f88f54f..e722162d8 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -19,14 +19,26 @@ package org.apache.fop.layoutmgr.inline; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.area.Area; +import org.apache.fop.area.LineArea; +import org.apache.fop.area.Trait; +import org.apache.fop.area.inline.InlineArea; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.Block; import org.apache.fop.fo.properties.CommonHyphenation; +import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.FontInfo; +import org.apache.fop.fonts.FontTriplet; import org.apache.fop.hyphenation.Hyphenation; import org.apache.fop.hyphenation.Hyphenator; import org.apache.fop.layoutmgr.BlockLevelLayoutManager; @@ -49,19 +61,6 @@ import org.apache.fop.layoutmgr.NonLeafPosition; import org.apache.fop.layoutmgr.Position; import org.apache.fop.layoutmgr.PositionIterator; import org.apache.fop.layoutmgr.SpaceSpecifier; -import org.apache.fop.area.Area; -import org.apache.fop.area.LineArea; -import org.apache.fop.area.inline.InlineArea; - -import java.util.ListIterator; -import java.util.List; -import java.util.ArrayList; -import java.util.LinkedList; -import org.apache.fop.area.Trait; -import org.apache.fop.fonts.Font; -import org.apache.fop.fonts.FontInfo; -import org.apache.fop.fonts.FontTriplet; - import org.apache.fop.traits.MinOptMax; /** @@ -381,11 +380,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager addedPositions = 0; } - if (difference + bestActiveNode.availableShrink < 0) { - if (super.log.isWarnEnabled()) { - super.log.warn(FONode.decorateWithContextInfo( + if (log.isWarnEnabled()) { + int lack = difference + bestActiveNode.availableShrink; + if (lack < 0) { + String textDiff = (lack < -50000 ? "more than 50 points" : (-lack) + "mpt"); + log.warn(FONode.decorateWithContextInfo( "Line " + (addedPositions + 1) - + " of a paragraph overflows the available area.", getFObj())); + + " of a paragraph overflows the available area by " + + textDiff + ".", getFObj())); } } |