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 bc...@apache.org on 2004/02/26 16:47:03 UTC

cvs commit: xml-fop/src/java/org/apache/fop/traits BlockProps.java

bckfnn      2004/02/26 07:47:03

  Modified:    src/java/org/apache/fop/fo FOPropertyMapping.java FObj.java
                        PropertyManager.java
               src/java/org/apache/fop/fo/flow ExternalGraphic.java
                        TableColumn.java
               src/java/org/apache/fop/layoutmgr
                        BlockContainerLayoutManager.java
                        BlockLayoutManager.java LineLayoutManager.java
                        PageLayoutManager.java
               src/java/org/apache/fop/layoutmgr/table Column.java Row.java
                        TableLayoutManager.java
               src/java/org/apache/fop/render/rtf RTFHandler.java
               src/java/org/apache/fop/traits BlockProps.java
  Log:
  Use the new property expressions. Clients must use Length when retrieving
  a length and must delay the call to Length.getValue() until the
  baselength has been assigned by the LayoutManagers.
  
  PR: 26778 (second half)
  
  Revision  Changes    Path
  1.11      +14 -2     xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java
  
  Index: FOPropertyMapping.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FOPropertyMapping.java	4 Feb 2004 12:38:27 -0000	1.10
  +++ FOPropertyMapping.java	26 Feb 2004 15:47:02 -0000	1.11
  @@ -304,6 +304,7 @@
           genericPadding = new LengthProperty.Maker(0);
           genericPadding.setInherited(false);
           genericPadding.setDefault("0pt");
  +        genericPadding.setPercentBase(LengthBase.BLOCK_WIDTH);
           genericPadding.addShorthand(s_generics[PR_PADDING]);
           
           // GenericCondBorderWidth
  @@ -1189,6 +1190,7 @@
           m.setInherited(false);
           m.setDefault("0pt");
           m.addShorthand(s_generics[PR_MARGIN]);
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("margin-top", m);
   
           // margin-bottom
  @@ -1196,6 +1198,7 @@
           m.setInherited(false);
           m.setDefault("0pt");
           m.addShorthand(s_generics[PR_MARGIN]);
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("margin-bottom", m);
   
           // margin-left
  @@ -1203,6 +1206,7 @@
           m.setInherited(false);
           m.setDefault("0pt");
           m.addShorthand(s_generics[PR_MARGIN]);
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("margin-left", m);
   
           // margin-right
  @@ -1210,6 +1214,7 @@
           m.setInherited(false);
           m.setDefault("0pt");
           m.addShorthand(s_generics[PR_MARGIN]);
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("margin-right", m);
   
           // space-before
  @@ -1343,6 +1348,7 @@
           // block-progression-dimension
           m = new LengthRangeProperty.Maker(PR_BLOCK_PROGRESSION_DIMENSION);
           m.setInherited(false);
  +        m.setPercentBase(LengthBase.BLOCK_HEIGHT);
           
           l = new LengthProperty.Maker(CP_MINIMUM);
           l.setDefault("auto");
  @@ -1372,6 +1378,7 @@
                {PR_MAX_HEIGHT, PR_MAX_HEIGHT, PR_MAX_WIDTH, }
           });
           pdim.setRelative(true);
  +        m.setCorresponding(pdim);
           addPropertyMaker("block-progression-dimension", m);
   
           // content-height
  @@ -1398,6 +1405,7 @@
           // inline-progression-dimension
           m = new LengthRangeProperty.Maker(PR_INLINE_PROGRESSION_DIMENSION);
           m.setInherited(false);
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           
           l = new LengthProperty.Maker(CP_MINIMUM);
           l.setDefault("auto");
  @@ -1427,6 +1435,7 @@
               {PR_MIN_WIDTH, PR_MIN_WIDTH, PR_MIN_HEIGHT, },
               {PR_MAX_WIDTH, PR_MAX_WIDTH, PR_MAX_HEIGHT, }
           });
  +        m.setCorresponding(pdim);
           addPropertyMaker("inline-progression-dimension", m);
   
           // max-height
  @@ -1471,7 +1480,7 @@
           l  = new LengthProperty.Maker(PR_WIDTH);
           l.setInherited(false);
           l.setAutoOk(true);
  -        l.setPercentBase(LengthBase.CONTAINING_BOX);
  +        l.setPercentBase(LengthBase.BLOCK_WIDTH);
           l.setDefault("auto");
           addPropertyMaker("width", l);
       }
  @@ -1580,6 +1589,7 @@
           m  = new LengthProperty.Maker(PR_TEXT_INDENT);
           m.setInherited(false);
           m.setDefault("0pt");
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("text-indent", m);
   
           // white-space-collapse
  @@ -2222,6 +2232,7 @@
           m  = new LengthProperty.Maker(PR_COLUMN_WIDTH);
           m.setInherited(false);
           m.setDefault("proportional-column-width(1)", true);
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("column-width", m);
   
           // empty-cells
  @@ -2476,6 +2487,7 @@
           m.setInherited(false);
           m.setDefault("");
           m.setDatatypeParser(new BoxPropShorthandParser());
  +        m.setPercentBase(LengthBase.BLOCK_WIDTH);
           addPropertyMaker("margin", m);
   
           // padding
  
  
  
  1.35      +49 -0     xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- FObj.java	2 Feb 2004 16:08:24 -0000	1.34
  +++ FObj.java	26 Feb 2004 15:47:02 -0000	1.35
  @@ -97,6 +97,11 @@
       protected Map markers = null;
   
       /**
  +     * Dynamic layout dimension. Used to resolve relative lengths.
  +     */
  +    protected Map layoutDimension = null;
  +
  +    /**
        * Create a new formatting object.
        * All formatting object classes extend this class.
        *
  @@ -235,6 +240,50 @@
       protected PropertyManager makePropertyManager(
               PropertyList propertyList) {
           return new PropertyManager(propertyList);
  +    }
  +
  +    /* This section is the implemenation of the property context. */
  +
  +    /**
  +     * Assign the size of a layout dimension to the key. 
  +     * @param key the Layout dimension, from PercentBase.
  +     * @param dimension The layout length.
  +     */
  +    public void setLayoutDimension(Integer key, int dimension) {
  +        if (layoutDimension == null){
  +            layoutDimension = new HashMap();
  +        }
  +        layoutDimension.put(key, new Integer(dimension));
  +    }
  +    
  +    /**
  +     * Assign the size of a layout dimension to the key. 
  +     * @param key the Layout dimension, from PercentBase.
  +     * @param dimension The layout length.
  +     */
  +    public void setLayoutDimension(Integer key, float dimension) {
  +        if (layoutDimension == null){
  +            layoutDimension = new HashMap();
  +        }
  +        layoutDimension.put(key, new Float(dimension));
  +    }
  +    
  +    /**
  +     * Return the size associated with the key.
  +     * @param key The layout dimension key.
  +     * @return the length.
  +     */
  +    public Number getLayoutDimension(Integer key) {
  +        if (layoutDimension != null) {
  +            Number result = (Number) layoutDimension.get(key);
  +            if (result != null) {
  +                return result;
  +            }
  +        }
  +        if (parent != null) {
  +            return ((FObj) parent).getLayoutDimension(key);
  +        }
  +        return new Integer(0);
       }
   
       /**
  
  
  
  1.23      +1 -1      xml-fop/src/java/org/apache/fop/fo/PropertyManager.java
  
  Index: PropertyManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- PropertyManager.java	2 Feb 2004 16:08:24 -0000	1.22
  +++ PropertyManager.java	26 Feb 2004 15:47:02 -0000	1.23
  @@ -465,7 +465,7 @@
        */
       public BlockProps getBlockProps() {
           BlockProps props = new BlockProps();
  -        props.firstIndent = this.propertyList.get(PR_TEXT_INDENT).getLength().getValue();
  +        props.firstIndent = this.propertyList.get(PR_TEXT_INDENT).getLength();
           props.lastIndent = 0;
               /*this.propertyList.get("last-line-end-indent").getLength().mvalue(); */
           props.textAlign = this.propertyList.get(PR_TEXT_ALIGN).getEnum();
  
  
  
  1.21      +9 -11     xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
  
  Index: ExternalGraphic.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ExternalGraphic.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ExternalGraphic.java	2 Feb 2004 16:08:25 -0000	1.20
  +++ ExternalGraphic.java	26 Feb 2004 15:47:03 -0000	1.21
  @@ -51,18 +51,16 @@
   package org.apache.fop.fo.flow;
   
   // XML
  -import org.xml.sax.Attributes;
  +import java.awt.geom.Rectangle2D;
   
  -// FOP
   import org.apache.fop.apps.FOPException;
  +import org.apache.fop.datatypes.Length;
   import org.apache.fop.fo.FONode;
  -import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FOTreeVisitor;
  -import org.apache.fop.fo.properties.LengthProperty;
  -import org.apache.fop.image.ImageFactory;
  +import org.apache.fop.fo.FObj;
   import org.apache.fop.image.FopImage;
  -// Java
  -import java.awt.geom.Rectangle2D;
  +import org.apache.fop.image.ImageFactory;
  +import org.xml.sax.Attributes;
   
   /**
    * External graphic formatting object.
  @@ -104,7 +102,7 @@
           url = ImageFactory.getURL(url);
   
           // assume lr-tb for now and just use the .optimum value of the range
  -        LengthProperty ipd = propertyList.get(PR_INLINE_PROGRESSION_DIMENSION).
  +        Length ipd = propertyList.get(PR_INLINE_PROGRESSION_DIMENSION).
                                       getLengthRange().getOptimum().getLength();
           if (!ipd.isAuto()) {
               viewWidth = ipd.getValue();
  @@ -114,7 +112,7 @@
                   viewWidth = ipd.getValue();
               }
           }
  -        LengthProperty bpd = propertyList.get(PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
  +        Length bpd = propertyList.get(PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
           if (!bpd.isAuto()) {
               viewHeight = bpd.getValue();
           } else {
  @@ -129,7 +127,7 @@
   
           int cwidth = -1;
           int cheight = -1;
  -        LengthProperty ch = propertyList.get(PR_CONTENT_HEIGHT).getLength();
  +        Length ch = propertyList.get(PR_CONTENT_HEIGHT).getLength();
           if (!ch.isAuto()) {
               /*if (ch.scaleToFit()) {
                   if (viewHeight != -1) {
  @@ -138,7 +136,7 @@
               } else {*/
               cheight = ch.getValue();
           }
  -        LengthProperty cw = propertyList.get(PR_CONTENT_WIDTH).getLength();
  +        Length cw = propertyList.get(PR_CONTENT_WIDTH).getLength();
           if (!cw.isAuto()) {
               /*if (cw.scaleToFit()) {
                   if (viewWidth != -1) {
  
  
  
  1.13      +3 -29     xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java
  
  Index: TableColumn.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TableColumn.java	2 Feb 2004 16:08:25 -0000	1.12
  +++ TableColumn.java	26 Feb 2004 15:47:03 -0000	1.13
  @@ -63,7 +63,6 @@
   
   import org.apache.fop.fo.properties.CommonBackground;
   import org.apache.fop.fo.properties.CommonBorderAndPadding;
  -import org.apache.fop.fo.properties.Property;
   
   /**
    * Class modelling the fo:table-column object. See Sec. 6.7.4 of the XSL-FO
  @@ -73,8 +72,7 @@
   
       private ColorType backgroundColor;
   
  -    private Length columnWidthPropVal;
  -    private int columnWidth;
  +    private Length columnWidth;
       private int columnOffset;
       private int numColumnsRepeated;
       private int iColumnNumber;
  @@ -91,27 +89,11 @@
       /**
        * @return Length object containing column width
        */
  -    public Length getColumnWidthAsLength() {
  -        return columnWidthPropVal;
  -    }
  -
  -    /**
  -     * @return the column width (in millipoints ??)
  -     */
  -    public int getColumnWidth() {
  +    public Length getColumnWidth() {
           return columnWidth;
       }
   
       /**
  -     * Set the column width value, overriding the value from the column-width
  -     * Property.
  -     * @param columnWidth the column width value in base units (millipoints ??)
  -     */
  -    public void setColumnWidth(int columnWidth) {
  -        this.columnWidth = columnWidth;
  -    }
  -
  -    /**
        * @return column number
        */
       public int getColumnNumber() {
  @@ -146,15 +128,7 @@
           this.backgroundColor =
               this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
   
  -        Property prop = this.propertyList.get(PR_COLUMN_WIDTH);
  -        if (prop != null) {
  -            columnWidthPropVal = propertyList.get(PR_COLUMN_WIDTH).getLength();
  -
  -            // This won't include resolved table-units or % values yet.
  -            columnWidth = columnWidthPropVal.getValue();
  -        } else {
  -            columnWidth = 300000;
  -        }
  +        columnWidth = this.propertyList.get(PR_COLUMN_WIDTH).getLength();
   
           // initialize id
           setupID();
  
  
  
  1.14      +6 -0      xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
  
  Index: BlockContainerLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- BlockContainerLayoutManager.java	10 Feb 2004 19:25:15 -0000	1.13
  +++ BlockContainerLayoutManager.java	26 Feb 2004 15:47:03 -0000	1.14
  @@ -64,6 +64,7 @@
   import org.apache.fop.area.CTM;
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.datatypes.Length;
  +import org.apache.fop.datatypes.PercentBase;
   import org.apache.fop.traits.MinOptMax;
   
   /**
  @@ -176,6 +177,11 @@
           // if starting add space before
           // stackSize.add(spaceBefore);
           BreakPoss lastPos = null;
  +
  +        fobj.setLayoutDimension(PercentBase.BLOCK_IPD, ipd);
  +        fobj.setLayoutDimension(PercentBase.BLOCK_BPD, bpd - bIndents);
  +        fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, ipd);
  +        fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, bpd - bIndents);
   
           while ((curLM = getChildLM()) != null) {
               // Make break positions and return blocks!
  
  
  
  1.13      +5 -0      xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- BlockLayoutManager.java	29 Jan 2004 19:43:05 -0000	1.12
  +++ BlockLayoutManager.java	26 Feb 2004 15:47:03 -0000	1.13
  @@ -54,6 +54,7 @@
   import java.util.ArrayList;
   import java.util.List;
   
  +import org.apache.fop.datatypes.PercentBase;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.TextInfo;
   import org.apache.fop.fo.PropertyManager;
  @@ -212,6 +213,10 @@
   
           BreakPoss lastPos = null;
   
  +        // Set context for percentage property values.
  +        fobj.setLayoutDimension(PercentBase.BLOCK_IPD, ipd);
  +        fobj.setLayoutDimension(PercentBase.BLOCK_BPD, -1);
  +        
           while ((curLM = getChildLM()) != null) {
               // Make break positions and return blocks!
               // Set up a LayoutContext
  
  
  
  1.13      +8 -8      xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
  
  Index: LineLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LineLayoutManager.java	5 Feb 2004 17:59:30 -0000	1.12
  +++ LineLayoutManager.java	26 Feb 2004 15:47:03 -0000	1.13
  @@ -50,6 +50,7 @@
    */
   package org.apache.fop.layoutmgr;
   
  +import org.apache.fop.datatypes.Length;
   import org.apache.fop.fo.PropertyManager;
   import org.apache.fop.fo.properties.CommonMarginBlock;
   import org.apache.fop.fo.properties.CommonHyphenation;
  @@ -109,7 +110,7 @@
   
       private BreakPoss prevBP = null; // Last confirmed break position
       private int bTextAlignment = TextAlign.JUSTIFY;
  -    private int iTextIndent = 0;
  +    private Length textIndent;
       private int iIndents = 0;
       private CommonHyphenation hyphProps;
   
  @@ -146,7 +147,7 @@
           iIndents = marginProps.startIndent + marginProps.endIndent;
           BlockProps blockProps = propMgr.getBlockProps();
           bTextAlignment = blockProps.textAlign;
  -        iTextIndent = blockProps.firstIndent;
  +        textIndent = blockProps.firstIndent;
           hyphProps = propMgr.getHyphenationProps();
       }
   
  @@ -178,10 +179,9 @@
           clearPrevIPD();
           int iPrevLineEnd = vecInlineBreaks.size();
   
  -        // Adjust available line length by text-indent. 
           if (iPrevLineEnd == 0 && bTextAlignment == TextAlign.START) {
  -            availIPD.subtract(new MinOptMax(iTextIndent));
  -        }        
  +            availIPD.subtract(new MinOptMax(textIndent.getValue()));
  +        }
           prevBP = null;
   
           while ((curLM = getChildLM()) != null) {
  @@ -453,7 +453,7 @@
           if (prev == null) {
               vecInlineBreaks.clear();
           } else if ((iPrev = vecInlineBreaks.indexOf(prev)) != -1) {
  -            for (int i = vecInlineBreaks.size(); iPrev < i; --i) {
  +            for (int i = vecInlineBreaks.size()-1; iPrev < i; --i) {
                   vecInlineBreaks.remove(i);
               }
           }
  @@ -623,9 +623,9 @@
               break;
               case TextAlign.START:
                   if (prevLineEnd == 0) {
  -                    indent = iTextIndent;
  +                    indent = textIndent.getValue();
                   }
  -            break;
  +                break;
               case TextAlign.CENTER:
                   indent = (targetWith - realWidth) / 2;
               break;
  
  
  
  1.30      +10 -0     xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
  
  Index: PageLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- PageLayoutManager.java	4 Feb 2004 13:04:17 -0000	1.29
  +++ PageLayoutManager.java	26 Feb 2004 15:47:03 -0000	1.30
  @@ -68,8 +68,10 @@
   import org.apache.fop.area.Footnote;
   import org.apache.fop.area.Resolveable;
   
  +import org.apache.fop.datatypes.PercentBase;
   import org.apache.fop.datatypes.FODimension;
   
  +import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.Constants;
   import org.apache.fop.fo.flow.Marker;
   import org.apache.fop.fo.pagination.PageNumberGenerator;
  @@ -254,6 +256,8 @@
               childLC.setRefIPD(flowIPD);
   
               if (!curLM.isFinished()) {
  +                fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, flowIPD);
  +                fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, flowBPD);
                   bp = curLM.getNextBreakPoss(childLC);
               }
               if (bp != null) {
  @@ -769,6 +773,10 @@
                   spm.propertyList.get(PR_PAGE_WIDTH).getLength().getValue();
           int pageHeight =
                   spm.propertyList.get(PR_PAGE_HEIGHT).getLength().getValue();
  +        // Set the page dimension as the toplevel containing block for margin.
  +        ((FObj) fobj.getParent()).setLayoutDimension(PercentBase.BLOCK_IPD, pageWidth);
  +        ((FObj) fobj.getParent()).setLayoutDimension(PercentBase.BLOCK_BPD, pageHeight);
  +        
           // Get absolute margin properties (top, left, bottom, right)
           CommonMarginBlock mProps = spm.getPropertyManager().getMarginProps();
   
  @@ -797,6 +805,8 @@
          for (Iterator regenum = spm.getRegions().values().iterator();
               regenum.hasNext();) {
              Region r = (Region)regenum.next();
  +           r.setLayoutDimension(PercentBase.BLOCK_IPD, pageWidth);
  +           r.setLayoutDimension(PercentBase.BLOCK_BPD, pageHeight);
              RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM);
              if (r.getRegionClassCode() == Region.BODY_CODE) {
                  rvp.setRegion(makeRegionBodyReferenceArea(r, rvp.getViewArea()));
  
  
  
  1.3       +3 -4      xml-fop/src/java/org/apache/fop/layoutmgr/table/Column.java
  
  Index: Column.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Column.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Column.java	12 Aug 2003 18:02:46 -0000	1.2
  +++ Column.java	26 Feb 2004 15:47:03 -0000	1.3
  @@ -50,6 +50,7 @@
    */ 
   package org.apache.fop.layoutmgr.table;
   
  +import org.apache.fop.datatypes.Length;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.PropertyManager;
   import org.apache.fop.layoutmgr.AbstractLayoutManager;
  @@ -70,7 +71,6 @@
    * column properties.
    */
   public class Column extends AbstractLayoutManager {
  -    private int columnWidth;
       private CommonBorderAndPadding borderProps = null;
       private CommonBackground backgroundProps;
   
  @@ -85,7 +85,6 @@
        */
       public void setFObj(FObj fobj) {
           super.setFObj(fobj);
  -        columnWidth = ((TableColumn)fobj).getColumnWidth();
       }
   
       /**
  @@ -136,8 +135,8 @@
        *
        * @return the width of the column
        */
  -    public int getWidth() {
  -        return columnWidth;
  +    public Length getWidth() {
  +        return ((TableColumn)fobj).getColumnWidth();
       }
   
       /**
  
  
  
  1.7       +2 -2      xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java
  
  Index: Row.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Row.java	7 Feb 2004 23:10:19 -0000	1.6
  +++ Row.java	26 Feb 2004 15:47:03 -0000	1.7
  @@ -191,7 +191,7 @@
               } else {
                   col = (Column)columns.get(cellcount - 1);
               }
  -            childLC.setRefIPD(col.getWidth());
  +            childLC.setRefIPD(col.getWidth().getValue());
   
               while (!curLM.isFinished()) {
                   if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
  @@ -343,7 +343,7 @@
                       childLM.setRowHeight(rowHeight);
                       childLM.addAreas(breakPosIter, lc);
                   }
  -                xoffset += col.getWidth();
  +                xoffset += col.getWidth().getValue();
               }
           }
   
  
  
  
  1.6       +24 -0     xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
  
  Index: TableLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TableLayoutManager.java	8 Sep 2003 17:00:56 -0000	1.5
  +++ TableLayoutManager.java	26 Feb 2004 15:47:03 -0000	1.6
  @@ -50,7 +50,10 @@
    */
   package org.apache.fop.layoutmgr.table;
   
  +import org.apache.fop.datatypes.Length;
  +import org.apache.fop.datatypes.PercentBase;
   import org.apache.fop.fo.PropertyManager;
  +import org.apache.fop.fo.properties.TableColLength;
   import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
   import org.apache.fop.layoutmgr.LayoutProcessor;
   import org.apache.fop.layoutmgr.LeafPosition;
  @@ -67,6 +70,7 @@
   import org.apache.fop.fo.properties.CommonBackground;
   
   import java.util.ArrayList;
  +import java.util.Iterator;
   import java.util.List;
   
   /**
  @@ -159,6 +163,26 @@
           // stackSize.add(spaceBefore);
           BreakPoss lastPos = null;
   
  +        fobj.setLayoutDimension(PercentBase.BLOCK_IPD, context.getRefIPD());
  +        fobj.setLayoutDimension(PercentBase.BLOCK_BPD, context.getStackLimit().opt);
  +        fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, context.getRefIPD());
  +        fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, context.getStackLimit().opt);
  +        
  +        int sumCols = 0;
  +        float factors = 0;
  +        if (columns != null) { 
  +            for (Iterator i = columns.iterator(); i.hasNext(); ) {
  +                Column column = (Column) i.next();
  +                Length width = column.getWidth();
  +                sumCols += width.getValue();
  +                if (width instanceof TableColLength) {
  +                    factors += ((TableColLength) width).getTableUnits();
  +                }
  +            }
  +        }
  +        if (sumCols < context.getRefIPD()) {
  +            fobj.setLayoutDimension(PercentBase.TABLE_UNITS, (context.getRefIPD() - sumCols) / factors);
  +        }
           MinOptMax headerSize = null;
           if (tableHeader != null) {
               tableHeader.setUserAgent(getUserAgent());
  
  
  
  1.18      +2 -2      xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java
  
  Index: RTFHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- RTFHandler.java	2 Feb 2004 16:08:27 -0000	1.17
  +++ RTFHandler.java	26 Feb 2004 15:47:03 -0000	1.18
  @@ -479,7 +479,7 @@
           }
   
           try {
  -            Integer iWidth = new Integer(tc.getColumnWidth() / 1000);
  +            Integer iWidth = new Integer(tc.getColumnWidth().getValue() / 1000);
               builderContext.getTableContext().setNextColumnWidth(iWidth.toString() + "pt");
               builderContext.getTableContext().setNextColumnRowSpanning(new Integer(0), null);
           } catch (Exception e) {
  
  
  
  1.2       +3 -1      xml-fop/src/java/org/apache/fop/traits/BlockProps.java
  
  Index: BlockProps.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/traits/BlockProps.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BlockProps.java	11 Mar 2003 13:05:36 -0000	1.1
  +++ BlockProps.java	26 Feb 2004 15:47:03 -0000	1.2
  @@ -50,13 +50,15 @@
    */ 
   package org.apache.fop.traits;
   
  +import org.apache.fop.datatypes.Length;
  +
   /**
    * Store all block-level layout properties on an FO.
    * Public "structure" allows direct member access.
    */
   public class BlockProps {
       
  -    public int firstIndent; // text-indent
  +    public Length firstIndent; // text-indent
       public int lastIndent; // last-line-indent
       public int textAlign;
       public int textAlignLast;
  
  
  

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