From a20f9a410fdd3f776f870434bc39219d5fc64b40 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Oct 2012 13:30:43 +0200 Subject: fdo#46808, Adapt xml::sax::XParser UNO service to new style The xml.sax.Parser service already existed, it just did not have a new-style service to create it. Change-Id: I6f145a7504ff9e149c802f723991954a2801cbc9 --- sd/source/core/CustomAnimationPreset.cxx | 8 ++------ sd/source/filter/xml/sdxmlwrp.cxx | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'sd') diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 8eb74eeaabcf..87e19f8ee4a5 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -266,11 +266,7 @@ Reference< XAnimationNode > implImportEffects( const Reference< XMultiServiceFac aParserInput.aInputStream = xInputStream; // get parser - Reference< xml::sax::XParser > xParser( xServiceFactory->createInstance("com.sun.star.xml.sax.Parser" ), UNO_QUERY ); - - DBG_ASSERT( xParser.is(), "Can't create parser" ); - if( !xParser.is() ) - return xRootNode; + Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( comphelper::getComponentContext(xServiceFactory) ); // get filter Reference< xml::sax::XDocumentHandler > xFilter( xServiceFactory->createInstance("com.sun.star.comp.Xmloff.AnimationsImport" ), UNO_QUERY ); diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 77caf60e8467..f9cf8e3a804f 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -58,9 +58,10 @@ #include #include #include -#include +#include #include #include +#include #include #include #include @@ -228,12 +229,7 @@ sal_Int32 ReadThroughComponent( aParserInput.aInputStream = xInputStream; // get parser - Reference< xml::sax::XParser > xParser( - rFactory->createInstance("com.sun.star.xml.sax.Parser" ), - UNO_QUERY ); - DBG_ASSERT( xParser.is(), "Can't create parser" ); - if( !xParser.is() ) - return SD_XML_READERROR; + Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(rFactory)); RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter -- cgit