gmazza      2004/01/07 14:25:43

  Modified:    src/codegen properties.xsl
               src/java/org/apache/fop/fo Property.java
  Log:
  More String->int conversions.
  
  Revision  Changes    Path
  1.29      +19 -13    xml-fop/src/codegen/properties.xsl
  
  Index: properties.xsl
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- properties.xsl    7 Jan 2004 21:10:36 -0000       1.28
  +++ properties.xsl    7 Jan 2004 22:25:42 -0000       1.29
  @@ -523,10 +523,12 @@
           super(propId);</xsl:text>
         <xsl:if test="compound">
           <xsl:text>
  -        m_shorthandMaker= getSubpropMaker("</xsl:text>
  -        <xsl:value-of select=
  -            'compound/[EMAIL PROTECTED]"true"]/name'/>
  -        <xsl:text>");</xsl:text>
  +        m_shorthandMaker= getSubpropMaker(Constants.CP_</xsl:text>
  +        <xsl:call-template name="makeEnumConstant">
  +          <xsl:with-param name="propstr" select=
  +                     'compound/[EMAIL PROTECTED]"true"]/name'/>
  +        </xsl:call-template>
  +        <xsl:text>);</xsl:text>
         </xsl:if>
         <xsl:text>
       }
  @@ -544,7 +546,7 @@
           return true;
       }
   
  -    protected Property.Maker getSubpropMaker(String subprop) {</xsl:text>
  +    protected Property.Maker getSubpropMaker(int subpropId) {</xsl:text>
           <xsl:for-each select="compound/subproperty">
             <xsl:variable name="spname">
               <xsl:call-template name="makeClassName">
  @@ -552,15 +554,17 @@
               </xsl:call-template>
             </xsl:variable>
             <xsl:text>
  -        if (subprop.equals("</xsl:text>
  -          <xsl:value-of select='name'/>
  -          <xsl:text>"))
  +        if (subpropId == Constants.CP_</xsl:text>
  +          <xsl:call-template name="makeEnumConstant">
  +            <xsl:with-param name="propstr" select="name"/>
  +          </xsl:call-template>
  +          <xsl:text>)
               return s_</xsl:text>
             <xsl:value-of select="$spname"/>
             <xsl:text>Maker;</xsl:text>
           </xsl:for-each>
           <xsl:text>
  -        return super.getSubpropMaker(subprop);
  +        return super.getSubpropMaker(subpropId);
       }
   
       protected Property setSubprop(Property baseProp, int subpropId,
  @@ -624,9 +628,11 @@
          // set default for subprop </xsl:text>
           <xsl:value-of select="."/>
           <xsl:text>
  -          subProp = getSubpropMaker("</xsl:text>
  -        <xsl:value-of select='.'/>
  -        <xsl:text>").make(pList, getDefaultFor</xsl:text>
  +       subProp = getSubpropMaker(Constants.CP_</xsl:text>
  +        <xsl:call-template name="makeEnumConstant">
  +          <xsl:with-param name="propstr" select="."/>
  +        </xsl:call-template>
  +        <xsl:text>).make(pList, getDefaultFor</xsl:text>
           <xsl:value-of select='$spname'/>
           <xsl:text>(), fo);
          p.setComponent(Constants.CP_</xsl:text>
  
  
  
  1.12      +5 -5      xml-fop/src/java/org/apache/fop/fo/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Property.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Property.java     7 Jan 2004 21:10:38 -0000       1.11
  +++ Property.java     7 Jan 2004 22:25:43 -0000       1.12
  @@ -141,12 +141,12 @@
            * of compound property types, such as "space".
            * Overridden by property maker subclasses which handle
            * compound properties.
  -         * @param subprop The name of the component for which a Maker is to
  -         * returned, for example "optimum", if the FO attribute is
  +         * @param subprop The Constants ID of the component for which a Maker is to
  +         * returned, for example CP_OPTIMUM, if the FO attribute is
            * space.optimum='10pt'.
            * @return the Maker object specified
            */
  -        protected Maker getSubpropMaker(String subprop) {
  +        protected Maker getSubpropMaker(int subpropId) {
               return null;
           }
   
  @@ -188,11 +188,11 @@
               if (baseProp == null) {
                   baseProp = makeCompound(propertyList, fo);
               }
  -            Maker spMaker = getSubpropMaker(partName);
  +            int partId = FOPropertyMapping.getSubPropertyId(partName);
  +            Maker spMaker = getSubpropMaker(partId);
               if (spMaker != null) {
                   Property p = spMaker.make(propertyList, value, fo);
                   if (p != null) {
  -                    int partId = FOPropertyMapping.getSubPropertyId(partName);
                       return setSubprop(baseProp, partId, p);
                   }
               } else {
  
  
  

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

Reply via email to