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/01/29 20:39:26 UTC

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

bckfnn      2004/01/29 11:39:26

  Modified:    src/java/org/apache/fop/fo PropertyManager.java
  Log:
  A hack to calculate the startIndent and endIndent based on either margin
  or startIndent.
  
  PR: 25802.
  
  Revision  Changes    Path
  1.21      +34 -4     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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- PropertyManager.java	17 Jan 2004 19:29:46 -0000	1.20
  +++ PropertyManager.java	29 Jan 2004 19:39:26 -0000	1.21
  @@ -311,10 +311,40 @@
                           getSpace().getOptimum().getLength().getValue();
           props.spaceAfter = this.propertyList.get(PR_SPACE_AFTER).
                           getSpace().getOptimum().getLength().getValue();
  -        props.startIndent = this.propertyList.get(PR_START_INDENT).
  -                        getLength().getValue();
  -        props.endIndent = this.propertyList.get(PR_END_INDENT).
  -                        getLength().getValue();
  +
  +
  +        // For now we do the section 5.3.2 calculation here.
  +        // This is a hack that doesn't deal correctly with:
  +        // - Reference vs. non-reference areas.
  +        // - writing mode, it mixes start and left.
  +        // - inherited values of margins and indents.
  +        // When the indents properties calculate this values correctly,
  +        // the block below can be removed and replaced with simple
  +        // props.startIndent = this.propertyList.get(PR_START_INDENT)
  +        // props.endIndent = this.propertyList.get(PR_END_INDENT)
  +        CommonBorderAndPadding bpProps = getBorderAndPadding();
  +
  +        int startIndent = 0;
  +        if (props.marginLeft != 0) {
  +            startIndent = props.marginLeft; 
  +        } else {
  +            startIndent = this.propertyList.get(PR_START_INDENT).
  +                                getLength().getValue(); 
  +        }
  +        props.startIndent = startIndent +
  +                            bpProps.getBorderStartWidth(false) +
  +                            bpProps.getPaddingStart(false);  
  +
  +        int endIndent = 0;
  +        if (props.marginRight != 0) {
  +            endIndent = props.marginRight; 
  +        } else {
  +            endIndent = this.propertyList.get(PR_END_INDENT).
  +                                getLength().getValue(); 
  +        }
  +        props.endIndent = endIndent +
  +                          bpProps.getBorderEndWidth(false) +
  +                          bpProps.getPaddingEnd(false);
   
           return props;
       }
  
  
  

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