diff options
Diffstat (limited to 'sax/source/fastparser/fastparser.cxx')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 83bd7daa83a2..d0d6979cd749 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -718,6 +718,8 @@ sal_Int32 FastSaxParserImpl::GetTokenWithContextNamespace( sal_Int32 nNamespaceT void FastSaxParserImpl::parseStream(const InputSource& maStructSource) throw (SAXException, IOException, RuntimeException, std::exception) { + xmlInitParser(); + // Only one text at one time MutexGuard guard( maMutex ); @@ -739,11 +741,11 @@ void FastSaxParserImpl::parseStream(const InputSource& maStructSource) try { // start the document - if( entity.mxDocumentHandler.is() ) + if( rEntity.mxDocumentHandler.is() ) { Reference< XLocator > xLoc( mxDocumentLocator.get() ); - entity.mxDocumentHandler->setDocumentLocator( xLoc ); - entity.mxDocumentHandler->startDocument(); + rEntity.mxDocumentHandler->setDocumentLocator( xLoc ); + rEntity.mxDocumentHandler->startDocument(); } rEntity.mbEnableThreads = (rEntity.maStructSource.aInputStream->available() > 10000); @@ -784,33 +786,33 @@ void FastSaxParserImpl::parseStream(const InputSource& maStructSource) } // finish document - if( entity.mxDocumentHandler.is() ) + if( rEntity.mxDocumentHandler.is() ) { - entity.mxDocumentHandler->endDocument(); + rEntity.mxDocumentHandler->endDocument(); } } catch (const SAXException&) { - popEntity(); // TODO free mpParser.myDoc ? - xmlFreeParserCtxt( entity.mpParser ); + xmlFreeParserCtxt( rEntity.mpParser ); + popEntity(); throw; } catch (const IOException&) { + xmlFreeParserCtxt( rEntity.mpParser ); popEntity(); - xmlFreeParserCtxt( entity.mpParser ); throw; } catch (const RuntimeException&) { + xmlFreeParserCtxt( rEntity.mpParser ); popEntity(); - xmlFreeParserCtxt( entity.mpParser ); throw; } + xmlFreeParserCtxt( rEntity.mpParser ); popEntity(); - xmlFreeParserCtxt( entity.mpParser ); } void FastSaxParserImpl::setFastDocumentHandler( const Reference< XFastDocumentHandler >& Handler ) throw (RuntimeException) |