diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-03 13:30:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-04 16:29:53 +0200 |
commit | a20f9a410fdd3f776f870434bc39219d5fc64b40 (patch) | |
tree | 079278e5859c5782fbe9bfcc34302d09bd8dfadd /svx/source | |
parent | bd6b41bce491ac5a5f562652b7e32045cc22c35c (diff) |
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
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/xml/xmlexport.cxx | 6 | ||||
-rw-r--r-- | svx/source/xml/xmlxtimp.cxx | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx index 7273fc7e4c86..0109eff91986 100644 --- a/svx/source/xml/xmlexport.cxx +++ b/svx/source/xml/xmlexport.cxx @@ -29,7 +29,7 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <com/sun/star/xml/sax/InputSource.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/lang/XComponent.hpp> @@ -190,6 +190,7 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInpu { // Get service factory Reference< lang::XMultiServiceFactory > xServiceFactory = comphelper::getProcessServiceFactory(); + Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); DBG_ASSERT( xServiceFactory.is(), "XMLReader::Read: got no service manager" ); if( !xServiceFactory.is() ) @@ -226,8 +227,7 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInpu aParserInput.aInputStream = xInputStream; // get parser - Reference< xml::sax::XParser > xParser( xServiceFactory->createInstance( OUString("com.sun.star.xml.sax.Parser") ), UNO_QUERY ); - DBG_ASSERT( xParser.is(), "Can't create parser" ); + Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( xContext ); // prepare filter arguments Sequence<Any> aFilterArgs( 2 ); diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index e552ddaf87e4..09cc96765948 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -31,7 +31,7 @@ #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/io/XActiveDataControl.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/uno/Sequence.hxx> @@ -393,13 +393,14 @@ bool SvxXMLXTableImport::load( const rtl::OUString &rPath, try { uno::Reference<lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); + uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); if( !xServiceFactory.is() ) { OSL_FAIL( "SvxXMLXTableImport::load: got no service manager" ); return false; } - uno::Reference< xml::sax::XParser > xParser( xServiceFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" ) ) ), uno::UNO_QUERY_THROW ); + uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( xContext ); xml::sax::InputSource aParserInput; comphelper::LifecycleProxy aNasty; |