summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-10 10:13:18 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-22 17:01:11 +0200
commitfb741b5e1e6aeaee74cf14af4f1cc152f0ab0952 (patch)
tree24864ba5addb12799a508ce4718868026519f057 /sd/source
parent9cabab002b1180650236f3d1f5fd32dfdd4bf79a (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 'sd/source')
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index f9cf8e3a804f..fb8598e8349b 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -59,6 +59,7 @@
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/XDTDHandler.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
+#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/io/XActiveDataControl.hpp>
#include <comphelper/componentcontext.hxx>
@@ -878,6 +879,7 @@ sal_Bool SdXMLFilter::Export()
}
uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() );
+ uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
if( !xServiceFactory.is() )
{
@@ -885,14 +887,7 @@ sal_Bool SdXMLFilter::Export()
return sal_False;
}
- uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( "com.sun.star.xml.sax.Writer" ) );
-
- if( !xWriter.is() )
- {
- OSL_FAIL( "com.sun.star.xml.sax.Writer service missing" );
- return sal_False;
- }
- uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY );
+ uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext );
/** property map for export info set */
PropertyMapEntry aExportInfoMap[] =
@@ -1076,7 +1071,7 @@ sal_Bool SdXMLFilter::Export()
if( xObjectResolver.is() ) *pArgs++ <<= xObjectResolver;
if( mxStatusIndicator.is() ) *pArgs++ <<= mxStatusIndicator;
- *pArgs <<= xHandler;
+ *pArgs <<= xWriter;
uno::Reference< document::XFilter > xFilter( xServiceFactory->createInstanceWithArguments( OUString::createFromAscii( pServices->mpService ), aArgs ), uno::UNO_QUERY );
if( xFilter.is() )