Author: lbernardo
Date: Sat Mar 16 00:27:00 2013
New Revision: 1457180

URL: http://svn.apache.org/r1457180
Log:
FOP-2221: Make overflow messages easier to read and fix wrong/ missing 
messages; patch submitted by Simon Steiner.

Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java?rev=1457180&r1=1457179&r2=1457180&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
 Sat Mar 16 00:27:00 2013
@@ -1040,6 +1040,9 @@ public class BlockContainerLayoutManager
 
     /** {@inheritDoc} */
     public boolean handleOverflow(int milliPoints) {
+        if (width.getEnum() == EN_AUTO) {
+            return false;
+        }
         if (milliPoints > this.horizontalOverflow) {
             this.horizontalOverflow = milliPoints;
         }

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml?rev=1457180&r1=1457179&r2=1457180&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml
 Sat Mar 16 00:27:00 2013
@@ -22,9 +22,9 @@
   <message key="tableFixedAutoWidthNotSupported">table-layout="fixed" and 
width="auto", but auto-layout not supported =&gt; 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 &gt; 
{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>

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java?rev=1457180&r1=1457179&r2=1457180&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
 Sat Mar 16 00:27:00 2013
@@ -59,11 +59,12 @@ public interface InlineLevelEventProduce
     /**
      * 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);
 
 }

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml?rev=1457180&r1=1457179&r2=1457180&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.xml
 Sat Mar 16 00:27:00 2013
@@ -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&lt;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&lt;more than 50 points}.{{locator}}</message>
 </catalogue>

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=1457180&r1=1457179&r2=1457180&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
 Sat Mar 16 00:27:00 2013
@@ -397,8 +397,13 @@ public class LineLayoutManager extends I
                     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());
+                    }
                 }
             }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to