dbertoni    01/04/27 12:18:55

  Modified:    c/src/PlatformSupport AttributesImpl.cpp AttributesImpl.hpp
  Log:
  Make sure attribute URIs and localNames are never null.
  
  Revision  Changes    Path
  1.2       +9 -20     xml-xalan/c/src/PlatformSupport/AttributesImpl.cpp
  
  Index: AttributesImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributesImpl.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AttributesImpl.cpp        2001/03/29 22:09:44     1.1
  +++ AttributesImpl.cpp        2001/04/27 19:18:53     1.2
  @@ -521,20 +521,15 @@
                        const XMLCh*    uri,
                        const XMLCh*    localName)
   {
  +     assert(name != 0);
  +     assert(type != 0);
  +     assert(value != 0);
  +     assert(uri != 0);
  +     assert(localName != 0);
  +
        if (m_cacheVector.size() == 0)
        {
  -             if (uri == 0)
  -             {
  -                     assert(localName == 0);
  -
  -                     return new AttributeVectorEntryExtended(name, value, 
type);
  -             }
  -             else
  -             {
  -                     assert(localName != 0);
  -
  -                     return new AttributeVectorEntryExtended(name, value, 
type, uri, localName);
  -             }
  +             return new AttributeVectorEntryExtended(name, value, type, uri, 
localName);
        }
        else
        {
  @@ -550,14 +545,8 @@
                theEntry->m_Name.insert(theEntry->m_Name.begin(), name, 
AttributeVectorEntry::endArray(name) + 1);
                theEntry->m_Value.insert(theEntry->m_Value.begin(), value, 
AttributeVectorEntry::endArray(value) + 1);
                theEntry->m_Type.insert(theEntry->m_Type.begin(), type, 
AttributeVectorEntry::endArray(type) + 1);
  -
  -             if (uri != 0)
  -             {
  -                     assert(localName != 0);
  -
  -                     theEntry->m_uri.insert(theEntry->m_uri.begin(), uri, 
AttributeVectorEntry::endArray(uri) + 1);
  -                     
theEntry->m_localName.insert(theEntry->m_localName.begin(), localName, 
AttributeVectorEntry::endArray(localName) + 1);
  -             }
  +             theEntry->m_uri.insert(theEntry->m_uri.begin(), uri, 
AttributeVectorEntry::endArray(uri) + 1);
  +             theEntry->m_localName.insert(theEntry->m_localName.begin(), 
localName, AttributeVectorEntry::endArray(localName) + 1);
   
                m_cacheVector.pop_back();
   
  
  
  
  1.2       +3 -1      xml-xalan/c/src/PlatformSupport/AttributesImpl.hpp
  
  Index: AttributesImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributesImpl.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AttributesImpl.hpp        2001/03/29 22:09:44     1.1
  +++ AttributesImpl.hpp        2001/04/27 19:18:54     1.2
  @@ -161,7 +161,9 @@
                        const XMLCh*    type,
                        const XMLCh*    value)
        {
  -             addAttribute(0, 0, qname, type, value);
  +             const XMLCh             theDummy = 0;
  +
  +             addAttribute(&theDummy, &theDummy, qname, type, value);
        }
   
        /**
  
  
  

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

Reply via email to