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/10/10 23:06:15 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/properties IndentPropertyMaker.java

bckfnn      2004/10/10 14:06:15

  Modified:    src/java/org/apache/fop/fo/properties
                        IndentPropertyMaker.java
  Log:
  Fully implement the 5.3.2 rules for calculating indent values.
  
  Revision  Changes    Path
  1.8       +23 -9     xml-fop/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
  
  Index: IndentPropertyMaker.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IndentPropertyMaker.java	22 Sep 2004 19:19:36 -0000	1.7
  +++ IndentPropertyMaker.java	10 Oct 2004 21:06:15 -0000	1.8
  @@ -69,20 +69,33 @@
        * @see CorrespondingPropertyMaker#compute(PropertyList)
        */
       public Property compute(PropertyList propertyList) throws FOPException {
  -        // TODO: bckfnn reenable
  -        if (propertyList.getExplicitOrShorthand(
  -                propertyList.getWritingMode(lr_tb, rl_tb, tb_rl)) == null) {
  -            return null;
  -        }
  +        PropertyList pList = getWMPropertyList(propertyList);
           // Calculate the values as described in 5.3.2.
           try {
  +            int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
  +            Numeric margin;
  +//          Calculate the absolute margin.
  +            if (propertyList.getExplicitOrShorthand(marginProp) == null) {
  +                Property indent = propertyList.getExplicit(baseMaker.propId);
  +                if (indent == null) {
  +                    margin = new FixedLength(0);
  +                } else {
  +                    margin = propertyList.getExplicit(baseMaker.propId).getNumeric();
  +                    margin = NumericOp.subtraction(margin, propertyList.getInherited(baseMaker.propId).getNumeric());
  +                }
  +                margin = NumericOp.subtraction(margin, getCorresponding(paddingCorresponding, propertyList).getNumeric());
  +                margin = NumericOp.subtraction(margin, getCorresponding(borderWidthCorresponding, propertyList).getNumeric());
  +            } else {
  +                margin = propertyList.get(marginProp).getNumeric();
  +            }
  +            
               Numeric v = new FixedLength(0);
               if (!propertyList.getFObj().generatesReferenceAreas()) {
                   // The inherited_value_of([start|end]-indent)
  -                v = NumericOp.addition(v, propertyList.getInherited(this.baseMaker.propId).getNumeric());
  +                v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
               }
               // The corresponding absolute margin-[right|left}.
  -            v = NumericOp.addition(v, propertyList.get(propertyList.getWritingMode(lr_tb, rl_tb, tb_rl)).getNumeric());
  +            v = NumericOp.addition(v, margin);
               v = NumericOp.addition(v, getCorresponding(paddingCorresponding, propertyList).getNumeric());
               v = NumericOp.addition(v, getCorresponding(borderWidthCorresponding, propertyList).getNumeric());
               return (Property) v;
  @@ -94,7 +107,8 @@
       }
       
       private Property getCorresponding(int[] corresponding, PropertyList propertyList) {
  -        int wmcorr = propertyList.getWritingMode(corresponding[0], corresponding[1], corresponding[2]);
  +        PropertyList pList = getWMPropertyList(propertyList);
  +        int wmcorr = pList.getWritingMode(corresponding[0], corresponding[1], corresponding[2]);
           return propertyList.get(wmcorr);
       }
   }
  
  
  

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