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...@locus.apache.org on 2000/08/30 00:19:04 UTC

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

dbertoni    00/08/29 15:19:04

  Modified:    c/src/XSLT NamespacesHandler.cpp
  Log:
  Fixed problem with map::erase() on more modern STL implementations.
  
  Revision  Changes    Path
  1.2       +21 -5     xml-xalan/c/src/XSLT/NamespacesHandler.cpp
  
  Index: NamespacesHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NamespacesHandler.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NamespacesHandler.cpp	2000/08/28 01:19:41	1.1
  +++ NamespacesHandler.cpp	2000/08/29 22:19:04	1.2
  @@ -543,6 +543,17 @@
   {
   	if (m_excludedResultPrefixes.size() > 0)
   	{
  +#if defined(XALAN_NO_NAMESPACES)
  +	typedef vector<NamespacesMapType::iterator> 		IteratorVectorType;
  +#else
  +	typedef std::vector<NamespacesMapType::iterator> 	IteratorVectorType;
  +#endif
  +
  +		// This vector will hold all of the iterators that we need to erase...
  +		IteratorVectorType	theDeadEntries;
  +
  +		theDeadEntries.reserve(m_excludedResultPrefixes.size());
  +
   		const NamespacesMapType::iterator	theEnd =
   				m_namespaceDeclarations.end();
   
  @@ -565,12 +576,17 @@
   				 m_extensionNamespaceURIs.find(theURI) != m_extensionNamespaceURIs.end()))
   			{
   				// It's excluded, so remove it...
  -				i = m_namespaceDeclarations.erase(i);
  -			}
  -			else
  -			{
  -				++i;
  +				theDeadEntries.push_back(i);
   			}
  +
  +			++i;
  +		}
  +
  +		while(theDeadEntries.size() > 0)
  +		{
  +			m_namespaceDeclarations.erase(theDeadEntries.back());
  +
  +			theDeadEntries.pop_back();
   		}
   	}
   }