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 je...@apache.org on 2005/12/02 10:52:54 UTC

svn commit: r351655 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/layoutmgr/ src/java/org/apache/fop/layoutmgr/list/ src/java/org/apache/fop/layoutmgr/table/ test/layoutengine/standard-testcases/

Author: jeremias
Date: Fri Dec  2 01:52:38 2005
New Revision: 351655

URL: http://svn.apache.org/viewcvs?rev=351655&view=rev
Log:
Implemented 5.3.4 overconstrained geometry without handling the case when the content IPD is zero.

Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java?rev=351655&r1=351654&r2=351655&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 Fri Dec  2 01:52:38 2005
@@ -92,6 +92,8 @@
                     .spaceBefore, this).getSpace();
         foBlockSpaceAfter = new SpaceVal(getBlockContainerFO().getCommonMarginBlock()
                     .spaceAfter, this).getSpace();
+        startIndent = getBlockContainerFO().getCommonMarginBlock().startIndent.getValue(this);
+        endIndent = getBlockContainerFO().getCommonMarginBlock().endIndent.getValue(this); 
 
         boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
         if (rotated) {
@@ -154,13 +156,6 @@
         return indents;
     }
     
-    private int getIPIndents() {
-        int iIndents = 0;
-        iIndents += getBlockContainerFO().getCommonMarginBlock().startIndent.getValue(this);
-        iIndents += getBlockContainerFO().getCommonMarginBlock().endIndent.getValue(this);
-        return iIndents;
-    }
-    
     private boolean isAbsoluteOrFixed() {
         return (abProps.absolutePosition == EN_ABSOLUTE) 
                 || (abProps.absolutePosition == EN_FIXED);
@@ -188,9 +183,8 @@
         
         autoHeight = false;
         //boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
-        referenceIPD = context.getRefIPD();
         int maxbpd = context.getStackLimit().opt;
-        int allocBPD, allocIPD;
+        int allocBPD;
         if (height.getEnum() == EN_AUTO 
                 || (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
             //auto height when height="auto" or "if that dimension is not specified explicitly 
@@ -201,15 +195,15 @@
             allocBPD = height.getValue(this); //this is the content-height
             allocBPD += getBPIndents();
         }
+        vpContentBPD = allocBPD - getBPIndents();
+
+        referenceIPD = context.getRefIPD();
         if (width.getEnum() == EN_AUTO) {
-            allocIPD = referenceIPD;
+            updateContentAreaIPDwithOverconstrainedAdjust();
         } else {
-            allocIPD = width.getValue(this); //this is the content-width
-            allocIPD += getIPIndents();
+            int contentWidth = width.getValue(this);
+            updateContentAreaIPDwithOverconstrainedAdjust(contentWidth);
         }
-
-        vpContentBPD = allocBPD - getBPIndents();
-        setContentAreaIPD(allocIPD - getIPIndents());
         
         double contentRectOffsetX = 0;
         contentRectOffsetX += getBlockContainerFO()
@@ -869,7 +863,7 @@
             //        this);
             TraitSetter.addMargins(viewportBlockArea, 
                     getBlockContainerFO().getCommonBorderPaddingBackground(),
-                    getBlockContainerFO().getCommonMarginBlock(),
+                    startIndent, endIndent,
                     this);
             
             viewportBlockArea.setCTM(absoluteCTM);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java Fri Dec  2 01:52:38 2005
@@ -68,6 +68,7 @@
     }
 
     public void initialize() {
+        super.initialize();
         Font fs = getBlockFO().getCommonFont().getFontState(
                   getBlockFO().getFOEventHandler().getFontInfo(), this);
         
@@ -75,6 +76,8 @@
         follow = -fs.getDescender();
         middleShift = -fs.getXHeight() / 2;
         lineHeight = getBlockFO().getLineHeight().getOptimum(this).getLength();
+        startIndent = getBlockFO().getCommonMarginBlock().startIndent.getValue(this);
+        endIndent = getBlockFO().getCommonMarginBlock().endIndent.getValue(this); 
         foSpaceBefore = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceBefore, this)
                             .getSpace();
         foSpaceAfter = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceAfter, this)
@@ -191,13 +194,6 @@
         return llm;
     }
 
-    private int getIPIndents() {
-        int iIndents = 0;
-        iIndents += getBlockFO().getCommonMarginBlock().startIndent.getValue(this);
-        iIndents += getBlockFO().getCommonMarginBlock().endIndent.getValue(this);
-        return iIndents;
-    }
-    
     /**
      * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#mustKeepTogether()
      */
@@ -413,9 +409,7 @@
         if (curBlockArea == null) {
             curBlockArea = new Block();
 
-            int contentIPD = referenceIPD - getIPIndents();
-            
-            curBlockArea.setIPD(contentIPD/*parentwidth*/);
+            curBlockArea.setIPD(super.getContentAreaIPD());
 
             TraitSetter.addBreaks(curBlockArea, 
                     getBlockFO().getBreakBefore(), getBlockFO().getBreakAfter());
@@ -434,7 +428,7 @@
                     discardPaddingBefore, discardPaddingAfter, false, false, this);
             TraitSetter.addMargins(curBlockArea,
                     getBlockFO().getCommonBorderPaddingBackground(), 
-                    getBlockFO().getCommonMarginBlock(),
+                    startIndent, endIndent,
                     this);
 
             setCurrentArea(curBlockArea); // ??? for generic operations

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Fri Dec  2 01:52:38 2005
@@ -59,6 +59,10 @@
     protected boolean firstVisibleMarkServed = false;
     /** Reference IPD available */
     protected int referenceIPD = 0;
+    /** the effective start-indent value */
+    protected int startIndent = 0;
+    /** the effective end-indent value */
+    protected int endIndent = 0;
     /**
      * Holds the (one-time use) fo:block space-before
      * and -after properties.  Large fo:blocks are split
@@ -175,6 +179,41 @@
     }
 
     /**
+     * Determines and sets the content area IPD based on available reference area IPD, start- and
+     * end-indent properties.
+     * end-indent is adjusted based on overconstrained geometry rules, if necessary.
+     * @return the resulting content area IPD
+     */
+    protected int updateContentAreaIPDwithOverconstrainedAdjust() {
+        int ipd = referenceIPD - (startIndent + endIndent);
+        if (ipd < 0) {
+            //5.3.4, XSL 1.0, Overconstrained Geometry
+            log.debug("Adjusting end-indent based on overconstrained geometry rules for " + fobj);
+            endIndent += ipd;
+            ipd = 0;
+            //TODO Should we skip layout for a block that has ipd=0?
+        }
+        setContentAreaIPD(ipd);
+        return ipd;
+    }
+    
+    /**
+     * Sets the content area IPD by directly supplying the value. 
+     * end-indent is adjusted based on overconstrained geometry rules, if necessary.
+     * @return the resulting content area IPD
+     */
+    protected int updateContentAreaIPDwithOverconstrainedAdjust(int contentIPD) {
+        int ipd = referenceIPD - (contentIPD + (startIndent + endIndent));
+        if (ipd < 0) {
+            //5.3.4, XSL 1.0, Overconstrained Geometry
+            log.debug("Adjusting end-indent based on overconstrained geometry rules for " + fobj);
+            endIndent += ipd;
+        }
+        setContentAreaIPD(contentIPD);
+        return contentIPD;
+    }
+    
+    /**
      * @see LayoutManager#getNextKnuthElements(LayoutContext, int)
      */
     public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
@@ -189,20 +228,7 @@
 
         referenceIPD = context.getRefIPD();
         
-        int iIndents = 0;
-        int bIndents = 0;
-        if (fobj instanceof org.apache.fop.fo.flow.Block) {
-            org.apache.fop.fo.flow.Block block = (org.apache.fop.fo.flow.Block)fobj;
-            iIndents = block.getCommonMarginBlock().startIndent.getValue(this) 
-                     + block.getCommonMarginBlock().endIndent.getValue(this);
-            bIndents = block.getCommonBorderPaddingBackground().getBPPaddingAndBorder(false, this);
-        }
-        int ipd = referenceIPD - iIndents;
-
-        MinOptMax stackSize = new MinOptMax();
-
-        // Set context for percentage property values.
-        setContentAreaIPD(ipd);
+        updateContentAreaIPDwithOverconstrainedAdjust();
 
         LinkedList returnedList = null;
         LinkedList contentList = new LinkedList();
@@ -231,12 +257,9 @@
             childLC.copyPendingMarksFrom(context);
             if (curLM instanceof LineLayoutManager) {
                 // curLM is a LineLayoutManager
-                // set stackLimit for lines
-                childLC.setStackLimit(new MinOptMax(ipd/*
-                                                         * - iIndents -
-                                                         * iTextIndent
-                                                         */));
-                childLC.setRefIPD(ipd);
+                // set stackLimit for lines (stack limit is now i-p-direction, not b-p-direction!)
+                childLC.setStackLimit(new MinOptMax(getContentAreaIPD()));
+                childLC.setRefIPD(getContentAreaIPD());
             } else {
                 // curLM is a ?
                 //childLC.setStackLimit(MinOptMax.subtract(context
@@ -1443,6 +1466,11 @@
         }
     }
 
+    /** @return the sum of start-indent and end-indent */
+    protected int getIPIndents() {
+        return startIndent + endIndent;
+    }
+    
     /**
      * Returns the IPD of the content area
      * @return the IPD of the content area

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java Fri Dec  2 01:52:38 2005
@@ -358,35 +358,52 @@
      * outside of the border rectangle to the area.
      * @param area the area to set the traits on.
      * @param bpProps the border, padding and background properties
-     * @param marginProps the margin properties.
+     * @param startIndent the effective start-indent value
+     * @param endIndent the effective end-indent value
      * @param context the context for evaluation of percentages
      */
     public static void addMargins(Area area,
                                   CommonBorderPaddingBackground bpProps,
-                                  CommonMarginBlock marginProps,
+                                  int startIndent, int endIndent,
                                   PercentBaseContext context) {
-        int startIndent = marginProps.startIndent.getValue(context);
         if (startIndent != 0) {
             area.addTrait(Trait.START_INDENT, new Integer(startIndent));
         }
         
-        int spaceStart = marginProps.startIndent.getValue(context)
+        int spaceStart = startIndent
                             - bpProps.getBorderStartWidth(false)
                             - bpProps.getPaddingStart(false, context);
         if (spaceStart != 0) {
             area.addTrait(Trait.SPACE_START, new Integer(spaceStart));
         }
 
-        int endIndent = marginProps.endIndent.getValue(context);
         if (endIndent != 0) {
             area.addTrait(Trait.END_INDENT, new Integer(endIndent));
         }
-        int spaceEnd = marginProps.endIndent.getValue(context)
+        int spaceEnd = endIndent
                             - bpProps.getBorderEndWidth(false)
                             - bpProps.getPaddingEnd(false, context);
         if (spaceEnd != 0) {
             area.addTrait(Trait.SPACE_END, new Integer(spaceEnd));
         }
+    }
+
+    /**
+     * Add space to a block area.
+     * Layout managers that create block areas can use this to add space
+     * outside of the border rectangle to the area.
+     * @param area the area to set the traits on.
+     * @param bpProps the border, padding and background properties
+     * @param marginProps the margin properties.
+     * @param context the context for evaluation of percentages
+     */
+    public static void addMargins(Area area,
+                                  CommonBorderPaddingBackground bpProps,
+                                  CommonMarginBlock marginProps,
+                                  PercentBaseContext context) {
+        int startIndent = marginProps.startIndent.getValue(context);
+        int endIndent = marginProps.endIndent.getValue(context);
+        addMargins(area, bpProps, startIndent, endIndent, context);
     }
 
     public static int getEffectiveSpace(double adjust, MinOptMax space) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java Fri Dec  2 01:52:38 2005
@@ -100,6 +100,8 @@
                 getListBlockFO().getCommonMarginBlock().spaceBefore, this).getSpace();
         foSpaceAfter = new SpaceVal(
                 getListBlockFO().getCommonMarginBlock().spaceAfter, this).getSpace();
+        startIndent = getListBlockFO().getCommonMarginBlock().startIndent.getValue(this);
+        endIndent = getListBlockFO().getCommonMarginBlock().endIndent.getValue(this); 
     }
 
     private void resetSpaces() {
@@ -109,13 +111,6 @@
         this.discardPaddingAfter = false;
         this.effSpaceBefore = foSpaceBefore;
         this.effSpaceAfter = foSpaceAfter;
-    }
-    
-    private int getIPIndents() {
-        int iIndents = 0;
-        iIndents += getListBlockFO().getCommonMarginBlock().startIndent.getValue(this);
-        iIndents += getListBlockFO().getCommonMarginBlock().endIndent.getValue(this);
-        return iIndents;
     }
     
     /** @see org.apache.fop.layoutmgr.BlockStackingLayoutManager */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java Fri Dec  2 01:52:38 2005
@@ -159,6 +159,8 @@
                 getListItemFO().getCommonMarginBlock().spaceBefore, this).getSpace();
         foSpaceAfter = new SpaceVal(
                 getListItemFO().getCommonMarginBlock().spaceAfter, this).getSpace();
+        startIndent = getListItemFO().getCommonMarginBlock().startIndent.getValue(this);
+        endIndent = getListItemFO().getCommonMarginBlock().endIndent.getValue(this); 
     }
 
     private void resetSpaces() {
@@ -168,13 +170,6 @@
         this.discardPaddingAfter = false;
         this.effSpaceBefore = foSpaceBefore;
         this.effSpaceAfter = foSpaceAfter;
-    }
-    
-    private int getIPIndents() {
-        int iIndents = 0;
-        iIndents += getListItemFO().getCommonMarginBlock().startIndent.getValue(this);
-        iIndents += getListItemFO().getCommonMarginBlock().endIndent.getValue(this);
-        return iIndents;
     }
     
     /** @see org.apache.fop.layoutmgr.LayoutManager */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java Fri Dec  2 01:52:38 2005
@@ -112,7 +112,8 @@
     }
     
 
-    private int getIPIndents() {
+    /** @see org.apache.fop.layoutmgr.BlockStackingLayoutManager#getIPIndents() */
+    protected int getIPIndents() {
         int iIndents = 0;
         int[] startEndBorderWidths = gridUnit.getStartEndBorderWidths();
         startBorderWidth += startEndBorderWidths[0];

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java?rev=351655&r1=351654&r2=351655&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java Fri Dec  2 01:52:38 2005
@@ -59,7 +59,6 @@
 
     private Block curBlockArea;
 
-    private int contentIPD;
     private int referenceBPD;
     private double tableUnits;
     private boolean autoLayout = true;
@@ -101,6 +100,8 @@
                 getTable().getCommonMarginBlock().spaceBefore, this).getSpace();
         foSpaceAfter = new SpaceVal(
                 getTable().getCommonMarginBlock().spaceAfter, this).getSpace();
+        startIndent = getTable().getCommonMarginBlock().startIndent.getValue(this);
+        endIndent = getTable().getCommonMarginBlock().endIndent.getValue(this); 
         
         if (getTable().isSeparateBorderModel()) {
             this.halfBorderSeparationBPD = getTable().getBorderSeparation().getBPD().getLength()
@@ -128,13 +129,6 @@
         this.effSpaceAfter = foSpaceAfter;
     }
     
-    private int getIPIndents() {
-        int iIndents = 0;
-        iIndents += getTable().getCommonMarginBlock().startIndent.getValue(this);
-        iIndents += getTable().getCommonMarginBlock().endIndent.getValue(this);
-        return iIndents;
-    }
-    
     /** @return half the value of border-separation.block-progression-dimension. */
     public int getHalfBorderSeparationBPD() {
         return halfBorderSeparationBPD;
@@ -164,19 +158,16 @@
         referenceIPD = context.getRefIPD();
 
         if (getTable().getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) {
-            referenceIPD = getTable().getInlineProgressionDimension().getOptimum(this)
+            int contentIPD = getTable().getInlineProgressionDimension().getOptimum(this)
                     .getLength().getValue(this);
-            contentIPD = referenceIPD;
+            updateContentAreaIPDwithOverconstrainedAdjust(contentIPD);
         } else {
             if (!getTable().isAutoLayout()) {
                 log.info("table-layout=\"fixed\" and width=\"auto\", "
                         + "but auto-layout not supported " 
                         + "=> assuming width=\"100%\"");
             }
-            contentIPD = referenceIPD - getIPIndents();
-        }
-        if (referenceIPD > context.getRefIPD()) {
-            log.warn("Allocated IPD exceeds available reference IPD");
+            updateContentAreaIPDwithOverconstrainedAdjust();
         }
 
         // either works out table of column widths or if proportional-column-width function
@@ -195,9 +186,9 @@
         }
         // sets TABLE_UNITS in case where one or more oldColumns is defined using 
         // proportional-column-width
-        if (sumCols < contentIPD) {
+        if (sumCols < getContentAreaIPD()) {
             if (tableUnits == 0.0) {
-                this.tableUnits = (contentIPD - sumCols) / factors;
+                this.tableUnits = (getContentAreaIPD() - sumCols) / factors;
             }
         }
 
@@ -337,7 +328,7 @@
         LayoutContext lc = new LayoutContext(0);
 
 
-        lc.setRefIPD(contentIPD);
+        lc.setRefIPD(getContentAreaIPD());
         contentLM.setStartXOffset(startXOffset);
         contentLM.addAreas(parentIter, lc);
         tableHeight += contentLM.getUsedBPD();
@@ -357,7 +348,7 @@
                 this);
         TraitSetter.addMargins(curBlockArea,
                 getTable().getCommonBorderPaddingBackground(), 
-                getTable().getCommonMarginBlock(),
+                startIndent, endIndent,
                 this);
         TraitSetter.addBreaks(curBlockArea, 
                 getTable().getBreakBefore(), getTable().getBreakAfter());
@@ -392,7 +383,7 @@
             
             TraitSetter.setProducerID(curBlockArea, getTable().getId());
 
-            curBlockArea.setIPD(contentIPD);
+            curBlockArea.setIPD(getContentAreaIPD());
             
             setCurrentArea(curBlockArea);
         }
@@ -484,14 +475,6 @@
         }
     }
     
-    /**
-     * Returns the IPD of the content area
-     * @return the IPD of the content area
-     */
-    public int getContentAreaIPD() {
-        return referenceIPD;
-    }
-   
     /**
      * Returns the BPD of the content area
      * @return the BPD of the content area

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml?rev=351655&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml Fri Dec  2 01:52:38 2005
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks 5.3.4 "Overconstrained Geometry".
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="normal">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block-container start-indent="20pt" end-indent="20pt" background-color="yellow" id="bc1">
+            <fo:block start-indent="0pt" end-indent="0pt" text-align-last="justify">5.3.4 Overconstrained Geometry</fo:block>
+          </fo:block-container>
+          <fo:block-container width="100%" start-indent="20pt" end-indent="20pt" background-color="yellow" id="bc2">
+            <fo:block start-indent="0pt" end-indent="0pt" text-align-last="justify">5.3.4 Overconstrained Geometry</fo:block>
+          </fo:block-container>
+
+          <fo:block-container space-before="10pt" inline-progression-dimension="3in" block-progression-dimension="5pt" background-color="orange">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block-container start-indent="5in - 2.5in" inline-progression-dimension="2.5in" block-progression-dimension="5pt" background-color="orange">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block-container start-indent="3in" end-indent="2.5in" background-color="yellow" id="bc3">
+            <fo:block start-indent="0pt" end-indent="0pt">5.3.4 Overconstrained Geometry</fo:block>
+          </fo:block-container>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- block-container 1 -->
+    <eval expected="320000" xpath="//block[@prod-id = 'bc1']/@ipd"/>
+    <eval expected="320000" xpath="//block[@prod-id = 'bc1']/@ipda"/>
+    <eval expected="20000" xpath="//block[@prod-id = 'bc1']/@start-indent"/>
+    <eval expected="20000" xpath="//block[@prod-id = 'bc1']/@end-indent"/>
+
+    <!-- block-container 2, end-indent is adjusted due to overconstrained relaxing -->
+    <eval expected="360000" xpath="//block[@prod-id = 'bc2']/@ipd"/>
+    <eval expected="360000" xpath="//block[@prod-id = 'bc2']/@ipda"/>
+    <eval expected="20000" xpath="//block[@prod-id = 'bc2']/@start-indent"/>
+    <eval expected="-20000" xpath="//block[@prod-id = 'bc2']/@end-indent"/>
+
+    <!-- block-container 3, end-indent is adjusted due to overconstrained relaxing -->
+    <eval expected="0" xpath="//block[@prod-id = 'bc3']/@ipd"/>
+    <eval expected="216000" xpath="//block[@prod-id = 'bc3']/@start-indent"/>
+    <eval expected="144000" xpath="//block[@prod-id = 'bc3']/@end-indent"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_overconstrained_ipd.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml?rev=351655&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml Fri Dec  2 01:52:38 2005
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks 5.3.4 "Overconstrained Geometry".
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="normal">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block-container inline-progression-dimension="3in" block-progression-dimension="5pt" background-color="orange">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block-container start-indent="5in - 2.5in" inline-progression-dimension="2.5in" block-progression-dimension="5pt" background-color="orange">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block start-indent="3in" end-indent="2.5in" background-color="yellow" id="mainblock">5.3.4 Overconstrained Geometry</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- end-indent is expected to be modified from 180000 to 144000 due to 5.3.4, XSL 1.0 -->
+    <eval expected="0" xpath="//block[@prod-id = 'mainblock']/@ipd"/>
+    <eval expected="216000" xpath="//block[@prod-id = 'mainblock']/@start-indent"/>
+    <eval expected="144000" xpath="//block[@prod-id = 'mainblock']/@end-indent"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block_overconstrained_ipd.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml?rev=351655&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml Fri Dec  2 01:52:38 2005
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks 5.3.4 "Overconstrained Geometry".
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in" margin-left="0.5in" margin-right="0.5in">
+          <fo:region-body background-color="lightgray"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="normal">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:table table-layout="fixed" start-indent="20pt" end-indent="20pt" border-collapse="separate" id="table1">
+            <fo:table-column/>
+            <fo:table-body start-indent="0pt" end-indent="0pt">
+              <fo:table-row>
+                <fo:table-cell background-color="yellow">
+                  <fo:block>content</fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+          <fo:table table-layout="fixed" width="100%" start-indent="20pt" end-indent="20pt" border-collapse="separate" id="table2">
+            <fo:table-column/>
+            <fo:table-body start-indent="0pt" end-indent="0pt">
+              <fo:table-row>
+                <fo:table-cell background-color="yellow">
+                  <fo:block>content</fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+          <fo:block-container space-before="10pt" inline-progression-dimension="3in" block-progression-dimension="5pt" background-color="orange">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block-container start-indent="4in - 1.5in" inline-progression-dimension="1.5in" block-progression-dimension="5pt" background-color="orange">
+            <fo:block/>
+          </fo:block-container>
+          <fo:table table-layout="fixed" start-indent="3in" end-indent="1.5in" border-collapse="separate" id="table3">
+            <fo:table-column/>
+            <fo:table-body start-indent="0pt" end-indent="0pt">
+              <fo:table-row>
+                <fo:table-cell background-color="yellow">
+                  <fo:block>5.3.4 Overconstrained Geometry</fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- table 1 -->
+    <eval expected="248000" xpath="//block[@prod-id = 'table1']/@ipd"/>
+    <eval expected="248000" xpath="//block[@prod-id = 'table1']/@ipda"/>
+    <eval expected="20000" xpath="//block[@prod-id = 'table1']/@start-indent"/>
+    <eval expected="20000" xpath="//block[@prod-id = 'table1']/@end-indent"/>
+
+    <!-- table 2, end-indent is adjusted due to overconstrained relaxing -->
+    <eval expected="288000" xpath="//block[@prod-id = 'table2']/@ipd"/>
+    <eval expected="288000" xpath="//block[@prod-id = 'table2']/@ipda"/>
+    <eval expected="20000" xpath="//block[@prod-id = 'table2']/@start-indent"/>
+    <eval expected="-20000" xpath="//block[@prod-id = 'table2']/@end-indent"/>
+
+    <!-- table 3, end-indent is adjusted due to overconstrained relaxing -->
+    <eval expected="0" xpath="//block[@prod-id = 'table3']/@ipd"/>
+    <eval expected="216000" xpath="//block[@prod-id = 'table3']/@start-indent"/>
+    <eval expected="72000" xpath="//block[@prod-id = 'table3']/@end-indent"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_overconstrained_ipd.xml
------------------------------------------------------------------------------
    svn:keywords = Id



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