klease      01/10/14 13:36:00

  Modified:    src/org/apache/fop/fo LengthProperty.java
  Log:
  Modify Length to Numeric conversion code
  
  Revision  Changes    Path
  1.5       +4 -13     xml-fop/src/org/apache/fop/fo/LengthProperty.java
  
  Index: LengthProperty.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/LengthProperty.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LengthProperty.java       2001/07/30 20:29:20     1.4
  +++ LengthProperty.java       2001/10/14 20:36:00     1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: LengthProperty.java,v 1.4 2001/07/30 20:29:20 tore Exp $
  + * $Id: LengthProperty.java,v 1.5 2001/10/14 20:36:00 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -8,8 +8,7 @@
   package org.apache.fop.fo;
   
   import org.apache.fop.datatypes.Length;
  -import org.apache.fop.datatypes.PercentLength;
  -import org.apache.fop.datatypes.TableColLength;
  +import org.apache.fop.datatypes.AutoLength;
   import org.apache.fop.fo.expr.Numeric;
   import org.apache.fop.apps.FOPException;
   
  @@ -40,7 +39,7 @@
               if (isAutoLengthAllowed()) {
                   String pval = p.getString();
                   if (pval != null && pval.equals("auto"))
  -                    return new LengthProperty(Length.AUTO);
  +                    return new LengthProperty(new AutoLength());
               }
               if (p instanceof LengthProperty)
                   return p;
  @@ -70,15 +69,7 @@
       }
   
       public Numeric getNumeric() {
  -        // Can't just do new Numeric(length) because it always uses
  -        // the constructor for Length!
  -        // Otherwise, must make each class know about Numeric...
  -        // ie, return length.asNumeric(): cleaner
  -        if (length instanceof PercentLength)
  -            return new Numeric((PercentLength)length);
  -        if (length instanceof TableColLength)
  -            return new Numeric((TableColLength)length);
  -        return new Numeric(length);
  +        return length.asNumeric() ;
       }
   
       public Length getLength() {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to