gmazza      2004/01/04 14:23:16

  Modified:    src/java/org/apache/fop/fo PropertyList.java
  Log:
  More string-->int conversions.
  
  Revision  Changes    Path
  1.17      +21 -19    xml-fop/src/java/org/apache/fop/fo/PropertyList.java
  
  Index: PropertyList.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- PropertyList.java 4 Jan 2004 22:04:08 -0000       1.16
  +++ PropertyList.java 4 Jan 2004 22:23:16 -0000       1.17
  @@ -482,7 +482,9 @@
           String basePropertyName = findBasePropertyName(attributeName);
           String subPropertyName = findSubPropertyName(attributeName);
   
  -        propertyMaker = findMaker(namespace, elementName, basePropertyName);
  +        int propId = FOPropertyMapping.getPropertyId(basePropertyName);
  +
  +        propertyMaker = findMaker(namespace, elementName, propId);
           if (propertyMaker == null) {
               handleInvalidProperty(attributeName);
               return;
  @@ -599,13 +601,11 @@
       public Property getSubpropValue(String space, String element,
                                       Property p, int propId) {
   
  -        String propertyName = FOPropertyMapping.getPropertyName(propId &
  -            Constants.PROPERTY_MASK);
  -                                        
           String subpropName = FOPropertyMapping.getPropertyName(propId &
               Constants.COMPOUND_MASK);
   
  -        Property.Maker maker = findMaker(space, element, propertyName);
  +        Property.Maker maker = findMaker(space, element, propId & 
  +            Constants.PROPERTY_MASK);
           if (maker != null) {
               return maker.getSubpropValue(p, subpropName);
           } else {
  @@ -619,10 +619,12 @@
        * @param propertyName name of property
        * @return value from the appropriate Property.Maker
        */
  -    public boolean isCorrespondingForced(String space, String element,
  +    private boolean isCorrespondingForced(String space, String element,
                                            String propertyName) {
  +        int propId = FOPropertyMapping.getPropertyId(propertyName);
  +                                             
           Property.Maker propertyMaker = findMaker(space, element,
  -                                                 propertyName);
  +                                                 propId);
           if (propertyMaker != null) {
               return propertyMaker.isCorrespondingForced(this);
           } else {
  @@ -639,8 +641,10 @@
        */
       public Property getShorthand(String space, String element,
           String propertyName) {
  +        int propId = FOPropertyMapping.getPropertyId(propertyName);
  +
           Property.Maker propertyMaker = findMaker(space, element,
  -                                                 propertyName);
  +                                                 propId);
           if (propertyMaker != null) {
               return propertyMaker.getShorthand(this);
           } else {
  @@ -659,11 +663,10 @@
       public Property makeProperty(String space, String element,
                                    int propId) throws FOPException {
   
  -        String propertyName = FOPropertyMapping.getPropertyName(propId);
           Property p = null;
   
           Property.Maker propertyMaker = findMaker(space, element,
  -                                                 propertyName);
  +                                                 propId);
           if (propertyMaker != null) {
               p = propertyMaker.make(this);
           } else {
  @@ -683,9 +686,10 @@
       public Property computeProperty(String space, String element, 
           String propertyName) {
   
  +        int propId = FOPropertyMapping.getPropertyId(propertyName);
           Property p = null;
           Property.Maker propertyMaker = findMaker(space, element,
  -                                                 propertyName);
  +                                                 propId);
           if (propertyMaker != null) {
               try {
                   p = propertyMaker.compute(this);
  @@ -713,8 +717,9 @@
                                  String propertyName) {
           boolean b;
   
  +        int propId = FOPropertyMapping.getPropertyId(propertyName);
           Property.Maker propertyMaker = findMaker(space, element,
  -                                                 propertyName);
  +                                                 propId);
           if (propertyMaker != null) {
               b = propertyMaker.isInherited();
           } else {
  @@ -727,19 +732,16 @@
       /**
        * @param space namespace of element
        * @param elementName name of element
  -     * @param propertyName name of property
  +     * @param propId Id of property
        * @return the Property.Maker for this property
        */
       private Property.Maker findMaker(String space, String elementName,
  -        String propertyName) {
  -
  -        // convert the string (e.g., "font-size") to its const value (PR_FONT_SIZE).
  -        int propertyId = FOPropertyMapping.getPropertyId(propertyName);
  +        int propId) {
   
  -        if (propertyId < 1 || propertyId > Constants.PROPERTY_COUNT) {
  +        if (propId < 1 || propId > Constants.PROPERTY_COUNT) {
               return null;
           } else {
  -            return FObj.propertyListTable[propertyId];
  +            return FObj.propertyListTable[propId];
           }
       }
       
  
  
  

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

Reply via email to