From 9adde1ec79eb2122631ae1be671d41e61d8945b0 Mon Sep 17 00:00:00 2001 From: Khaled Noaman <knoaman@apache.org> Date: Thu, 2 Jan 2003 16:38:00 +0000 Subject: [PATCH] Some cleanup. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174572 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/internal/ElemStack.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/xercesc/internal/ElemStack.cpp b/src/xercesc/internal/ElemStack.cpp index e733ce1e8..5d92d1fe7 100644 --- a/src/xercesc/internal/ElemStack.cpp +++ b/src/xercesc/internal/ElemStack.cpp @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.4 2003/01/02 16:38:00 knoaman + * Some cleanup. + * * Revision 1.3 2002/12/04 02:23:50 knoaman * Scanner re-organization. * @@ -234,8 +237,8 @@ ElemStack::addLevel(XMLElementDecl* const toSet, const unsigned int readerNum) } // Set up the new top row - fStack[fStackTop]->fThisElement = 0; - fStack[fStackTop]->fReaderNum = 0xFFFFFFFF; + fStack[fStackTop]->fThisElement = toSet; + fStack[fStackTop]->fReaderNum = readerNum; fStack[fStackTop]->fChildCount = 0; fStack[fStackTop]->fMapCount = 0; fStack[fStackTop]->fValidationFlag = false; @@ -243,10 +246,6 @@ ElemStack::addLevel(XMLElementDecl* const toSet, const unsigned int readerNum) fStack[fStackTop]->fCurrentScope = Grammar::TOP_LEVEL_SCOPE; fStack[fStackTop]->fCurrentGrammar = 0; - // And store the new stuff - fStack[fStackTop]->fThisElement = toSet; - fStack[fStackTop]->fReaderNum = readerNum; - // Bump the top of stack fStackTop++; @@ -459,15 +458,17 @@ void ElemStack::reset( const unsigned int emptyId , const unsigned int xmlId , const unsigned int xmlNSId) { - // Flush the prefix pool and put back in the standard prefixes - fPrefixPool.flushAll(); - fGlobalPoolId = fPrefixPool.addOrFind(XMLUni::fgZeroLenString); - fXMLPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLString); - fXMLNSPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLNSString); - // Reset the stack top to clear the stack fStackTop = 0; + // if first time, put in the standard prefixes + if (fXMLPoolId == 0) { + + fGlobalPoolId = fPrefixPool.addOrFind(XMLUni::fgZeroLenString); + fXMLPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLString); + fXMLNSPoolId = fPrefixPool.addOrFind(XMLUni::fgXMLNSString); + } + // And store the new special URI ids fEmptyNamespaceId = emptyId; fUnknownNamespaceId = unknownId; -- GitLab