diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-10 10:13:18 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-22 17:01:11 +0200 |
commit | fb741b5e1e6aeaee74cf14af4f1cc152f0ab0952 (patch) | |
tree | 24864ba5addb12799a508ce4718868026519f057 /svx | |
parent | 9cabab002b1180650236f3d1f5fd32dfdd4bf79a (diff) |
fdo#46808, Adapt xml::sax::XWriter UNO service to new style
Create a merged XWriter interface for the service.
The xml.sax.Writer service already existed, it just did not have
an IDL file.
Change-Id: I4e6d3f3c68f9282a55fc7aa19778f97632fd8ad5
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xml/xmlexport.cxx | 9 | ||||
-rw-r--r-- | svx/source/xml/xmlxtexp.cxx | 10 |
2 files changed, 6 insertions, 13 deletions
diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx index 0109eff91986..f7f97ce2b3a1 100644 --- a/svx/source/xml/xmlexport.cxx +++ b/svx/source/xml/xmlexport.cxx @@ -32,6 +32,7 @@ #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/xml/sax/Writer.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp> @@ -77,6 +78,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutp } uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); + uno::Reference< uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); if( !xServiceFactory.is() ) { OSL_FAIL( "got no service manager" ); @@ -85,12 +87,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutp if( bDocRet ) { - uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( OUString( "com.sun.star.xml.sax.Writer" ) ) ); - if( !xWriter.is() ) - { - OSL_FAIL( "com.sun.star.xml.sax.Writer service missing" ); - bDocRet = sal_False; - } + uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext ); ::comphelper::IEmbeddedHelper *pPersist = pModel->GetPersist(); if( pPersist ) diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index a2f8322b1763..794d61d9291e 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -28,7 +28,7 @@ #include <tools/urlobj.hxx> #include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> #include <com/sun/star/drawing/LineDash.hpp> @@ -237,18 +237,14 @@ bool SvxXMLXTableExportComponent::save( try { uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); + uno::Reference< uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); if( !xServiceFactory.is() ) { OSL_FAIL( "got no service manager" ); return false; } - uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ) ); - if( !xWriter.is() ) - { - OSL_FAIL( "com.sun.star.xml.sax.Writer service missing" ); - return false; - } + uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext ); uno::Reference < io::XStream > xStream; uno::Reference < io::XOutputStream > xOut; |