]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed incorrect IPD for blocks nested in inlines and added IPD adjustment for inlineb...
authorManuel Mall <manuel@apache.org>
Wed, 12 Oct 2005 16:11:47 +0000 (16:11 +0000)
committerManuel Mall <manuel@apache.org>
Wed, 12 Oct 2005 16:11:47 +0000 (16:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@314953 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
src/java/org/apache/fop/render/AbstractRenderer.java
test/layoutengine/testcases/inline_border_padding_block_nested.xml

index cd7d962c8f7445de33618d1be32289bdc3b47a80..fdfcca3730abd7eaa85037247f59f5a3f594d6f5 100755 (executable)
@@ -235,12 +235,12 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
 
         if (borderProps != null) {
             childLC.setLineStartBorderAndPaddingWidth(context.getLineStartBorderAndPaddingWidth()
-                + borderProps.getPadding(CommonBorderPaddingBackground.START, true, this)
-                + borderProps.getBorderWidth(CommonBorderPaddingBackground.START, true)
+                + borderProps.getPaddingStart(true, this)
+                + borderProps.getBorderStartWidth(true)
              );
             childLC.setLineEndBorderAndPaddingWidth(context.getLineEndBorderAndPaddingWidth()
-                + borderProps.getPadding(CommonBorderPaddingBackground.END, true, this)
-                + borderProps.getBorderWidth(CommonBorderPaddingBackground.END, true)
+                + borderProps.getPaddingEnd(true, this)
+                + borderProps.getBorderEndWidth(true)
              );
         }
         
@@ -250,7 +250,10 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
                 // Leave room for start/end border and padding
                 if (borderProps != null) {
                     childLC.setRefIPD(childLC.getRefIPD()
-                            - borderProps.getIPPaddingAndBorder(false, this));
+                            - borderProps.getPaddingStart(lastChildLM != null, this)
+                            - borderProps.getBorderStartWidth(lastChildLM != null)
+                            - borderProps.getPaddingEnd(hasNextChildLM(), this)
+                            - borderProps.getBorderEndWidth(hasNextChildLM()));
                 }
             }
             // get KnuthElements from curLM
index eda205d943178483944c5b20ded70a9717af3600..16c8f75aed559ce1a72a11989845e10e6f5f1a3f 100644 (file)
@@ -659,6 +659,7 @@ public abstract class AbstractRenderer
      * @param ibp the inline block parent to render
      */
     protected void renderInlineBlockParent(InlineBlockParent ibp) {
+        currentIPPosition += ibp.getBorderAndPaddingWidthStart();
         // For inline content the BP position is updated by the enclosing line area
         int saveBP = currentBPPosition;
         renderBlock(ibp.getChildArea());
index 4536cb0dda0cb90bee4d7f14c897a4ec07273af8..81c340bd5652f088eccce9d81a50935628ebc851 100755 (executable)
   <checks>
     <eval expected="347000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@ipd"/>
     <eval expected="350000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@ipda"/>
-    <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[1]/inlineblockparent/@border-after"/>
+    <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-after"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-before"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-start"/>
     <eval expected="2000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@padding-after"/>
     <eval expected="2000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@padding-before"/>
     <eval expected="2000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@padding-start"/>
-    <eval expected="48910" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipd"/>
-    <eval expected="51910" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipda"/>
-    <eval expected="1375" xpath="//flow/block[2]/lineArea[3]/inlineparent/@offset"/>
+    <eval expected="46130" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipd"/>
+    <eval expected="49130" xpath="//flow/block[2]/lineArea[3]/inlineparent/@ipda"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-after"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-before"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[3]/inlineparent/@border-end"/>
 
     <eval expected="54470" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipd"/>
     <eval expected="57470" xpath="//flow/block[5]/lineArea[1]/inlineparent/@ipda"/>
-    <eval expected="1375" xpath="//flow/block[5]/lineArea[1]/inlineparent/@offset"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-after"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-before"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[1]/inlineparent/@border-start"/>
     
     <eval expected="54470" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipd"/>
     <eval expected="57470" xpath="//flow/block[8]/lineArea[1]/inlineparent/@ipda"/>
-    <eval expected="1375" xpath="//flow/block[8]/lineArea[1]/inlineparent/@offset"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-after"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-before"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[1]/inlineparent/@border-start"/>
     <eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@padding-before"/>
     <eval expected="46130" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipd"/>
     <eval expected="49130" xpath="//flow/block[8]/lineArea[3]/inlineparent/@ipda"/>
-    <eval expected="1375" xpath="//flow/block[8]/lineArea[3]/inlineparent/@offset"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-after"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-before"/>
     <eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[3]/inlineparent/@border-end"/>