xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/XalanTransformer XalanTransformer.cpp
Date Mon, 12 Aug 2002 03:59:51 GMT
dbertoni    2002/08/11 20:59:51

  Modified:    c/src/XalanTransformer XalanTransformer.cpp
  Log:
  Use per-thread ICU collator instance to take advantage of caching.
  
  Revision  Changes    Path
  1.56      +12 -15    xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp
  
  Index: XalanTransformer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- XalanTransformer.cpp	22 Jul 2002 22:30:25 -0000	1.55
  +++ XalanTransformer.cpp	12 Aug 2002 03:59:51 -0000	1.56
  @@ -132,10 +132,6 @@
   
   const XSLTInit*		XalanTransformer::s_xsltInit = 0;
   
  -#if defined(XALAN_USE_ICU)
  -static const ICUBridgeCollationCompareFunctor*	theICUFunctor = 0;
  -#endif
  -
   
   
   XalanTransformer::XalanTransformer():
  @@ -157,7 +153,13 @@
   	m_stylesheetExecutionContext(new StylesheetExecutionContextDefault)
   {
   #if defined(XALAN_USE_ICU)
  -	m_stylesheetExecutionContext->installCollationCompareFunctor(theICUFunctor);
  +	// Create a collation function for the ICU, and have it
  +	// cache collators...
  +	XalanAutoPtr<ICUBridgeCollationCompareFunctor>	theICUFunctor(new ICUBridgeCollationCompareFunctor(true));
  +
  +	m_stylesheetExecutionContext->installCollationCompareFunctor(theICUFunctor.get());
  +
  +	theICUFunctor.release();
   #endif
   }
   
  @@ -184,6 +186,11 @@
   		delete m_functionPairs[i].second;
   	}
   
  +#if defined(XALAN_USE_ICU)
  +	// Uninstall the ICU collation compare functor, and destroy it...
  +	delete m_stylesheetExecutionContext->uninstallCollationCompareFunctor();
  +#endif
  +
   	delete m_stylesheetExecutionContext;
   }
   
  @@ -202,8 +209,6 @@
   	XalanEXSLTStringFunctionsInstaller::installGlobal();
   
   #if defined(XALAN_USE_ICU)
  -	theICUFunctor = new ICUBridgeCollationCompareFunctor;
  -
   	// Install the ICU version of format-number...
   	XPath::installFunction(
   			StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("format-number")),
  @@ -234,14 +239,6 @@
   #if defined(XALAN_USE_ICU)
   	XPath::uninstallFunction(
   			StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("format-number")));
  -
  -#if defined(XALAN_CANNOT_DELETE_CONST)
  -	delete (ICUBridgeCollationCompareFunctor*)theICUFunctor;
  -#else
  -	delete theICUFunctor;
  -#endif
  -
  -	theICUFunctor = 0;
   
   	ICUBridgeCleanup::cleanup();
   #endif
  
  
  

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


Mime
View raw message