You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2005/07/26 22:09:18 UTC

cvs commit: xml-xalan/c/src/xalanc/XSLT ElemNumber.cpp

dbertoni    2005/07/26 13:09:18

  Modified:    c/src/xalanc/PlatformSupport DOMStringHelper.cpp
                        DOMStringHelper.hpp
               c/src/xalanc/XSLT ElemNumber.cpp
  Log:
  Patch for Jira issue XALANC-536.
  
  Revision  Changes    Path
  1.11      +50 -8     xml-xalan/c/src/xalanc/PlatformSupport/DOMStringHelper.cpp
  
  Index: DOMStringHelper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DOMStringHelper.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DOMStringHelper.cpp	22 Apr 2005 20:52:41 -0000	1.10
  +++ DOMStringHelper.cpp	26 Jul 2005 20:09:17 -0000	1.11
  @@ -523,9 +523,27 @@
   
   
   
  +template <class FunctionType>
  +XalanDOMString&
  +TransformString(
  +			FunctionType		theFunction,
  +            XalanDOMString&     theString)
  +{
  +	TransformString(
  +			theString.begin(),
  +			theString.end(),
  +			theString.begin(),
  +			theFunction);
  +
  +	return theString;
  +}
  +
  +
  +
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toLowerCaseASCII(const XalanDOMChar*	theString,
  -                 XalanDOMString&         theResult)
  +toLowerCaseASCII(
  +            const XalanDOMChar*     theString,
  +            XalanDOMString&         theResult)
   {
       TransformString(theString, length(theString), toLowerASCII, theResult);
   
  @@ -535,8 +553,9 @@
   
   
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toLowerCaseASCII(const XalanDOMString&	theString,
  -                 XalanDOMString&         theResult)
  +toLowerCaseASCII(
  +            const XalanDOMString&	theString,
  +            XalanDOMString&         theResult)
   {
       TransformXalanDOMString(theString, toLowerASCII, theResult);
   
  @@ -546,8 +565,20 @@
   
   
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toUpperCaseASCII(const XalanDOMChar*	theString,
  -                 XalanDOMString&         theResult)
  +toLowerCaseASCII(XalanDOMString&    theString)
  +{
  +    TransformString(toLowerASCII, theString);
  +
  +	return theString;
  +}
  +
  +
  +
  +
  +XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  +toUpperCaseASCII(
  +            const XalanDOMChar*     theString,
  +            XalanDOMString&         theResult)
   {
       TransformString(theString, length(theString), toUpperASCII, theResult);
   
  @@ -557,8 +588,9 @@
   
   
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toUpperCaseASCII(const XalanDOMString&	theString,
  -                 XalanDOMString&         theResult)
  +toUpperCaseASCII(
  +            const XalanDOMString&	theString,
  +            XalanDOMString&         theResult)
   {
       TransformXalanDOMString(theString, toUpperASCII, theResult);
   
  @@ -567,6 +599,16 @@
   
   
   
  +XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  +toUpperCaseASCII(XalanDOMString&    theString)
  +{
  +    TransformString(toUpperASCII, theString);
  +
  +	return theString;
  +}
  +
  +
  +
   template <class InputCharType, class OutputCharType>
   class IdentityTransform
   {
  
  
  
  1.15      +50 -12    xml-xalan/c/src/xalanc/PlatformSupport/DOMStringHelper.hpp
  
  Index: DOMStringHelper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DOMStringHelper.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DOMStringHelper.hpp	29 Apr 2005 21:39:42 -0000	1.14
  +++ DOMStringHelper.hpp	26 Jul 2005 20:09:17 -0000	1.15
  @@ -1356,11 +1356,14 @@
    * lower case.  This function works only with the characters
    * a-z and A-Z.
    *
  - * @param theString target string
  - * @return string containing lower case characters
  + * @param theString The source string
  + * @param theResult The target string
  + * @return A reference to theResult
    */
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toLowerCaseASCII(const XalanDOMChar*    theString, XalanDOMString&         theResult);
  +toLowerCaseASCII(
  +            const XalanDOMChar*     theString,
  +            XalanDOMString&         theResult);
   
   
   
  @@ -1369,11 +1372,27 @@
    * lower case.  This function works only with the characters
    * a-z and A-Z.
    *
  - * @param theString target string
  - * @return string containing lower case characters
  + * @param theString The source string
  + * @param theResult The target string
  + * @return A reference to theResult
  + */
  +XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  +toLowerCaseASCII(
  +            const XalanDOMString&   theString,
  +            XalanDOMString&         theResult);
  +
  +
  +
  +/**
  + * Converts ASCII alphabetic characters from upper case to
  + * lower case.  This function works only with the characters
  + * a-z and A-Z.
  + *
  + * @param theString The string to convert
  + * @return A reference to theString
    */
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toLowerCaseASCII(const XalanDOMString&  theString, XalanDOMString& theResult);
  +toLowerCaseASCII(XalanDOMString&    theString);
   
   
   
  @@ -1382,11 +1401,14 @@
    * upper case.  This function works only with the characters
    * a-z and A-Z.
    *
  - * @param theString target string
  - * @return string containing upper case characters
  + * @param theString The source string
  + * @param theResult The target string
  + * @return A reference to theResult
    */
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toUpperCaseASCII(const XalanDOMChar*    theString, XalanDOMString&  theResult);
  +toUpperCaseASCII(
  +            const XalanDOMChar*     theString,
  +            XalanDOMString&         theResult);
   
   
   
  @@ -1395,11 +1417,27 @@
    * upper case.  This function works only with the characters
    * a-z and A-Z.
    *
  - * @param theString target string
  - * @return string containing upper case characters
  + * @param theString The source string
  + * @param theResult The target string
  + * @return A reference to theResult
  + */
  +XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  +toUpperCaseASCII(
  +            const XalanDOMString&   theString,
  +            XalanDOMString&         theResult);
  +
  +
  +
  +/**
  + * Converts ASCII alphabetic characters from lower case to
  + * upper case.  This function works only with the characters
  + * a-z and A-Z.
  + *
  + * @param theString The string to convert
  + * @return A reference to theString
    */
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString&)
  -toUpperCaseASCII(const XalanDOMString&  theString, XalanDOMString&  theResult);
  +toUpperCaseASCII(XalanDOMString&    theString);
   
   
   
  
  
  
  1.19      +5 -17     xml-xalan/c/src/xalanc/XSLT/ElemNumber.cpp
  
  Index: ElemNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemNumber.cpp,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ElemNumber.cpp	12 May 2005 07:41:45 -0000	1.18
  +++ ElemNumber.cpp	26 Jul 2005 20:09:17 -0000	1.19
  @@ -1327,16 +1327,10 @@
               {
                   int2alphaCount(listElement, s_alphaCountTable, s_alphaCountTableSize, theResult);
   
  -                StylesheetExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
  -                
  -                XalanDOMString& thetmpResult = theGuard.get();
  -
  -                toLowerCaseASCII(theResult,thetmpResult);
  -
  -                theResult = thetmpResult;
  -
  -                break;
  +                toLowerCaseASCII(theResult);
               }
  +            break;
  +
           case XalanUnicode::charLetter_I:
               toRoman(listElement, true, theResult);
               break;
  @@ -1345,15 +1339,9 @@
               {
                   toRoman(listElement, true, theResult);
   
  -                StylesheetExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
  -                
  -                XalanDOMString& thetmpResult = theGuard.get();
  -
  -                toLowerCaseASCII(theResult,thetmpResult);
  -
  -                theResult = thetmpResult;
  -                break;
  +                toLowerCaseASCII(theResult);
               }
  +            break;
   
           case 0x3042:
           case 0x3044:
  
  
  

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