pbwest      2002/11/29 08:30:17

  Modified:    src/org/apache/fop/fo/properties Tag: FOP_0-20-0_Alt-Design
                        TextDecoration.java
  Log:
  Add getAlternativeIndex().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +7 -6      
xml-fop/src/org/apache/fop/fo/properties/Attic/TextDecoration.java
  
  Index: TextDecoration.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/properties/Attic/TextDecoration.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- TextDecoration.java       31 Oct 2002 02:55:11 -0000      1.1.2.4
  +++ TextDecoration.java       29 Nov 2002 16:30:17 -0000      1.1.2.5
  @@ -56,6 +56,12 @@
                                   ,BLINK
                               };
   
  +    private int getAlternativeIndex(String alt) throws PropertyException {
  +        for (int i = 1; i < alternatives.length; i++)
  +            if (alt.equals(alternatives[i])) return i;
  +        throw new PropertyException("Invalid text decoration: " + alt);
  +    }
  +
       public PropertyValue refineParsing
                           (int propindex, FONode foNode, PropertyValue list)
                       throws PropertyException
  @@ -93,12 +99,7 @@
                   str2 = str.substring(3);
                   negate = true;
               }
  -            try {
  -                i = getEnumIndex(str2);
  -            } catch (PropertyException e) {
  -                throw new PropertyException
  -                                ("text-decoration: unknown value " + str);
  -            }
  +            i = getAlternativeIndex(str2);
               if (negate) offMask |= decorations[i];
               else         onMask |= decorations[i];
           }
  
  
  

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

Reply via email to