summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-24 10:26:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-24 10:26:23 +0200
commita449e0d2425fdedc02fae793a925dd0702d70319 (patch)
tree35edbc1ad66cc14fd0b936bb1220f5f1bfc9e979 /oox
parentb1211e965aa7883b0c3fc157f6c56b48c8bb0462 (diff)
use rtl::Reference in FastParser
instead of storing both a raw pointer and a uno::Reference Change-Id: I6b67a6098a3ccdce7e29ee8d601c743897032eaf
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/fastparser.cxx8
-rw-r--r--oox/source/core/filterdetect.cxx2
-rw-r--r--oox/source/core/xmlfilterbase.cxx7
-rw-r--r--oox/source/docprop/ooxmldocpropimport.cxx2
4 files changed, 8 insertions, 11 deletions
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
index 54b07b18102c..ce0a6c0a89f9 100644
--- a/oox/source/core/fastparser.cxx
+++ b/oox/source/core/fastparser.cxx
@@ -63,13 +63,11 @@ InputStreamCloseGuard::~InputStreamCloseGuard()
} // namespace
-FastParser::FastParser( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
- mrNamespaceMap( StaticNamespaceMap::get() ),
- mpParser(nullptr)
+FastParser::FastParser() throw( RuntimeException ) :
+ mrNamespaceMap( StaticNamespaceMap::get() )
{
// create a fast parser instance
- mxParser = css::xml::sax::FastParser::create(rxContext);
- mpParser = dynamic_cast<sax_fastparser::FastSaxParser*>(mxParser.get());
+ mxParser = new sax_fastparser::FastSaxParser;
// create the fast tokenhandler
mxTokenHandler.set( new FastTokenHandler );
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index f7a8f8125df5..c333db3fb25a 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -403,7 +403,7 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
if( aZipStorage.isStorage() )
{
// create the fast parser, register the XML namespaces, set document handler
- FastParser aParser( mxContext );
+ FastParser aParser;
aParser.registerNamespace( NMSP_packageRel );
aParser.registerNamespace( NMSP_officeRel );
aParser.registerNamespace( NMSP_packageContentTypes );
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 48da8c7cbe71..21f0b505e986 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -188,7 +188,6 @@ struct XmlFilterBaseImpl
XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
mxContext(rxContext),
- maFastParser( rxContext ),
maBinSuffix( ".bin" ),
mrNamespaceMap(StaticNamespaceMap::get())
{
@@ -268,9 +267,9 @@ void XmlFilterBase::importDocumentProperties()
checkDocumentProperties(xDocProps);
}
-FastParser* XmlFilterBase::createParser() const
+FastParser* XmlFilterBase::createParser()
{
- FastParser* pParser = new FastParser(getComponentContext());
+ FastParser* pParser = new FastParser;
registerNamespaces(*pParser);
return pParser;
}
@@ -305,7 +304,7 @@ OUString XmlFilterBase::getFragmentPathFromFirstTypeFromOfficeDoc( const OUStrin
bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHandler )
{
- FastParser aParser(mxImpl->mxContext);
+ FastParser aParser;
registerNamespaces(aParser);
return importFragment(rxHandler, aParser);
}
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index 1aa4c4a09ce8..2d78d30517e3 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -159,7 +159,7 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
if( aCoreStreams.getLength() > 1 )
throw IOException( "Unexpected core properties stream!" );
- ::oox::core::FastParser aParser( mxContext );
+ ::oox::core::FastParser aParser;
aParser.registerNamespace( NMSP_packageMetaCorePr );
aParser.registerNamespace( NMSP_dc );
aParser.registerNamespace( NMSP_dcTerms );