auriemma    00/11/06 14:24:29

  Modified:    c/src/XPath FunctionSubstringAfter.cpp
  Log:
  Merged string class changes from hpp to cpp.
  
  Revision  Changes    Path
  1.2       +14 -5     xml-xalan/c/src/XPath/FunctionSubstringAfter.cpp
  
  Index: FunctionSubstringAfter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstringAfter.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FunctionSubstringAfter.cpp        2000/11/06 19:49:15     1.1
  +++ FunctionSubstringAfter.cpp        2000/11/06 22:24:22     1.2
  @@ -87,12 +87,14 @@
   
        const unsigned int              theFirstStringLength = 
length(theFirstString);
   
  -#if !defined(XALAN_NO_NAMESPACES)
  -     using std::vector;
  +#if defined(XALAN_NO_NAMESPACES)
  +     typedef vector<XalanDOMChar>            VectorType;
  +#else
  +     typedef std::vector<XalanDOMChar>       VectorType;
   #endif
   
        // This buffer will hold the output characters.
  -     vector<XalanDOMChar>    theBuffer;
  +     VectorType      theBuffer;
   
        if (theIndex < theFirstStringLength)
        {
  @@ -109,9 +111,16 @@
                }
        }
   
  -     return executionContext.getXObjectFactory().createString(
  -             XalanDOMString(theBuffer.begin(), theBuffer.size()));
  +     const VectorType::size_type             theSize = theBuffer.size();
   
  +     if (theSize == 0)
  +     {
  +             return 
executionContext.getXObjectFactory().createString(XalanDOMString());
  +     }
  +     else
  +     {
  +             return 
executionContext.getXObjectFactory().createString(XalanDOMString(theBuffer.begin(),
 theSize));
  +     }
   }
   
   
  
  
  

Reply via email to