Author: lbernardo
Date: Mon Apr 15 21:43:05 2013
New Revision: 1468239

URL: http://svn.apache.org/r1468239
Log:
FOP-2221: Make overflow messages easier to read and fix wrong/ missing 
messages; applied second patch 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.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.xml
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.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=1468239&r1=1468238&r2=1468239&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
 Mon Apr 15 21:43:05 2013
@@ -1040,9 +1040,6 @@ 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.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java?rev=1468239&r1=1468238&r2=1468239&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
 Mon Apr 15 21:43:05 2013
@@ -132,6 +132,23 @@ public interface BlockLevelEventProducer
             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
      * @param flowName the flow name

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=1468239&r1=1468238&r2=1468239&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
 Mon Apr 15 21:43:05 2013
@@ -22,9 +22,10 @@
   <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">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="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="staticRegionOverflow">The contents of {elementName} on page 
{page} exceed its 'extent' value by {amount} millipoints.{clip,if, Content will 
be clipped.}{{locator}}</message>
+  <message key="regionOverflow">The contents of {elementName} on page {page} 
exceed its viewport 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/StaticContentLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java?rev=1468239&r1=1468238&r2=1468239&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
 Mon Apr 15 21:43:05 2013
@@ -147,7 +147,7 @@ public class StaticContentLayoutManager 
                 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());



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

Reply via email to