diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-25 12:50:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-25 14:19:03 +0100 |
commit | 2c757293b819118780eef3a30bb4434528d38673 (patch) | |
tree | 35beab468034fbeab06137452542d0d9191bb309 /sax | |
parent | 2ce31e56efaf1e429ecc13fd80b6767cb9ea585b (diff) |
reduce static_initialization_and_destruction chain
Change-Id: I0c1b2f2d908c31d1510662880c13504d81445a6a
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 42e4371f7882..3bb910ef6487 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -230,6 +230,7 @@ class SaxExpatParser_Impl { public: // module scope Mutex aMutex; + OUString sCDATA; Reference< XDocumentHandler > rDocumentHandler; Reference< XExtendedDocumentHandler > rExtendedDocumentHandler; @@ -263,6 +264,11 @@ public: // module scope Locale locale; public: + SaxExpatParser_Impl() + : sCDATA("CDATA") + { + } + // the C-Callbacks for the expat parser void static callbackStartElement(void *userData, const XML_Char *name , const XML_Char **atts); void static callbackEndElement(void *userData, const XML_Char *name); @@ -789,10 +795,6 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , const XML_Char *pwName , const XML_Char **awAttributes ) { - // in case of two concurrent threads, there is only the danger of an leak, - // which is neglectable for one string - static OUString g_CDATA( "CDATA" ); - SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis); if( pImpl->rDocumentHandler.is() ) { @@ -804,7 +806,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , OSL_ASSERT( awAttributes[i+1] ); pImpl->pAttrList->addAttribute( XML_CHAR_TO_OUSTRING( awAttributes[i] ) , - g_CDATA , // expat doesn't know types + pImpl->sCDATA, // expat doesn't know types XML_CHAR_TO_OUSTRING( awAttributes[i+1] ) ); i +=2; } |