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 2004/12/28 03:27:24 UTC

cvs commit: xml-xalan/c/src/xalanc/XPath XPathEvaluator.cpp

dbertoni    2004/12/27 18:27:24

  Modified:    c/src/xalanc/XPath XPathEvaluator.cpp
  Log:
  Fixes for GCC 3.4.
  
  Revision  Changes    Path
  1.7       +56 -10    xml-xalan/c/src/xalanc/XPath/XPathEvaluator.cpp
  
  Index: XPathEvaluator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XPathEvaluator.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XPathEvaluator.cpp	10 Nov 2004 19:09:11 -0000	1.6
  +++ XPathEvaluator.cpp	28 Dec 2004 02:27:24 -0000	1.7
  @@ -271,11 +271,17 @@
   {
   	XPathEnvSupportDefault	theEnvSupportDefault(m_memoryManager);
   
  +    const ElementPrefixResolverProxy    thePrefixResolver(
  +                    namespaceNode,
  +                    theEnvSupportDefault,
  +                    domSupport,
  +                    m_memoryManager);
  +
   	return evaluate(
   			domSupport,
   			contextNode,
   			xpathString,
  -			ElementPrefixResolverProxy(namespaceNode, theEnvSupportDefault, domSupport, m_memoryManager),
  +			thePrefixResolver,
   			theEnvSupportDefault);
    
   }
  @@ -291,11 +297,17 @@
   {
   	XPathEnvSupportDefault	theEnvSupportDefault(m_memoryManager);
   
  +    const ElementPrefixResolverProxy    thePrefixResolver(
  +                    namespaceNode,
  +                    theEnvSupportDefault,
  +                    domSupport,
  +                    m_memoryManager);
  +
   	return evaluate(
   				domSupport,
   				contextNode,
   				xpath,
  -				ElementPrefixResolverProxy(namespaceNode, theEnvSupportDefault, domSupport, m_memoryManager),
  +				thePrefixResolver,
   				theEnvSupportDefault);
   }
   
  @@ -343,9 +355,16 @@
   XPathEvaluator::createXPath(const XalanDOMChar*		xpathString)
   {
   	DOMSupportDefault		theDOMSupport(m_memoryManager);
  -	XPathEnvSupportDefault	theEnvSupportDefault(m_memoryManager);
   
  -	return createXPath(xpathString, ElementPrefixResolverProxy(0, theEnvSupportDefault, theDOMSupport, m_memoryManager));
  +    XPathEnvSupportDefault	theEnvSupportDefault(m_memoryManager);
  +
  +    const ElementPrefixResolverProxy    thePrefixResolver(
  +                    0,
  +                    theEnvSupportDefault,
  +                    theDOMSupport,
  +                    m_memoryManager);
  +
  +	return createXPath(xpathString, thePrefixResolver);
   }
   
   
  @@ -358,11 +377,21 @@
   {
   	XPathEnvSupportDefault	theEnvSupportDefault(m_memoryManager);
   
  -	return createXPath(xpathString, ElementPrefixResolverProxy( namespaceNode, theEnvSupportDefault, domSupport, m_memoryManager));
  +    const ElementPrefixResolverProxy    thePrefixResolver(
  +                    namespaceNode,
  +                    theEnvSupportDefault,
  +                    domSupport,
  +                    m_memoryManager);
  +
  +	return createXPath(xpathString, thePrefixResolver);
   }
   
   
   
  +typedef XPathConstructionContext::GetAndReleaseCachedString     GetAndReleaseCachedString;
  +
  +
  +
   XPath*
   XPathEvaluator::createXPath(
   			const XalanDOMChar*		xpathString,
  @@ -373,10 +402,16 @@
   
   	XPathProcessorImpl		theProcessor(m_memoryManager);
   
  +    GetAndReleaseCachedString   theGuard(*m_constructionContext.get());
  +
  +    XalanDOMString&     theTempString = theGuard.get();
  +
  +    theTempString = xpathString;
  +
       theProcessor.initXPath(
   			*theXPath,
   			*m_constructionContext.get(),
  -			XalanDOMString(xpathString, m_memoryManager),
  +			theTempString,
   			prefixResolver);
   
   	return theXPath;
  @@ -414,17 +449,28 @@
   
   	// Create an XPath, and an XPathProcessorImpl to process
   	// the XPath.
  -	XPath					theXPath(m_memoryManager);
  +	XPath				theXPath(m_memoryManager);
   
  -	XPathProcessorImpl		theProcessor(m_memoryManager);
  +	XPathProcessorImpl  theProcessor(m_memoryManager);
  +
  +    GetAndReleaseCachedString   theGuard(*m_constructionContext.get());
  +
  +    XalanDOMString&     theTempString = theGuard.get();
  +
  +    theTempString = xpathString;
   
       theProcessor.initXPath(
   			theXPath,
   			*m_constructionContext.get(),
  -			XalanDOMString(xpathString,m_memoryManager),
  +			theTempString,
   			prefixResolver);
   
  -	return evaluate(domSupport, contextNode, theXPath, prefixResolver, envSupport);
  +	return evaluate(
  +                domSupport,
  +                contextNode,
  +                theXPath,
  +                prefixResolver,
  +                envSupport);
   }
   
   
  
  
  

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