You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2013/10/24 18:26:27 UTC

svn commit: r1535430 - in /xmlgraphics/fop/branches/Temp_InlineContainer: src/java/org/apache/fop/layoutmgr/inline/ test/layoutengine/standard-testcases/

Author: vhennebert
Date: Thu Oct 24 16:26:26 2013
New Revision: 1535430

URL: http://svn.apache.org/r1535430
Log:
Issue a warning if the content of an inline-container overflows it in the block-progression-direction

Modified:
    xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
    xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml
    xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_bpd.xml

Modified: xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java?rev=1535430&r1=1535429&r2=1535430&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java Thu Oct 24 16:26:26 2013
@@ -35,6 +35,7 @@ import org.apache.fop.fonts.Font;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.layoutmgr.AbstractLayoutManager;
+import org.apache.fop.layoutmgr.BlockLevelEventProducer;
 import org.apache.fop.layoutmgr.ElementListUtils;
 import org.apache.fop.layoutmgr.InlineKnuthSequence;
 import org.apache.fop.layoutmgr.KnuthPossPosIter;
@@ -106,10 +107,19 @@ public class InlineContainerLayoutManage
     private void determineBPD() {
         LengthRangeProperty bpd = ((InlineContainer) fobj).getBlockProgressionDimension();
         Property optimum = bpd.getOptimum(this); // TODO percent base context
+        int actualBPD = ElementListUtils.calcContentLength(childElements);
         if (optimum.isAuto()) {
-            contentAreaBPD = ElementListUtils.calcContentLength(childElements);
+            contentAreaBPD = actualBPD;
         } else {
             contentAreaBPD = optimum.getLength().getValue(this); // TODO percent base context
+            if (contentAreaBPD < actualBPD) {
+                BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
+                        fobj.getUserAgent().getEventBroadcaster());
+                boolean canRecover = (((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW);
+                eventProducer.viewportBPDOverflow(this, fobj.getName(),
+                        actualBPD - contentAreaBPD, needClip(), canRecover,
+                        fobj.getLocator());
+            }
         }
     }
 

Modified: xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml?rev=1535430&r1=1535429&r2=1535430&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml (original)
+++ xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_auto-ipd.xml Thu Oct 24 16:26:26 2013
@@ -42,7 +42,7 @@
         <fo:flow flow-name="xsl-region-body">
           <fo:block-container space-before="10pt" start-indent="100pt" width="100pt">
             <fo:block start-indent="0">
-              Before: <fo:inline-container height="20pt">
+              Before: <fo:inline-container>
                 <fo:block>Inside the inline-container.</fo:block>
               </fo:inline-container> After.
             </fo:block>

Modified: xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_bpd.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_bpd.xml?rev=1535430&r1=1535429&r2=1535430&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_bpd.xml (original)
+++ xmlgraphics/fop/branches/Temp_InlineContainer/test/layoutengine/standard-testcases/inline-container_bpd.xml Thu Oct 24 16:26:26 2013
@@ -37,10 +37,20 @@
             </fo:inline-container> After.</fo:block>
         </fo:flow>
       </fo:page-sequence>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>Before: <fo:inline-container width="70pt" height="35pt" overflow="hidden">
+              <fo:block>This text overflows the inline-container in the 
+                block-progression-direction.</fo:block>
+            </fo:inline-container> After.</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
     </fo:root>
   </fo>
 
   <checks>
-    <eval expected="40000" xpath="//viewport/@bpd"/>
+    <eval expected="40000" xpath="//pageSequence[1]//viewport/@bpd"/>
+    <eval expected="35000" xpath="//pageSequence[2]//viewport/@bpd"/>
+    <true xpath="//pageSequence[2]//viewport/@clip"/>
   </checks>
 </testcase>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org