From fb741b5e1e6aeaee74cf14af4f1cc152f0ab0952 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 10 Oct 2012 10:13:18 +0200 Subject: 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 --- package/source/manifest/ManifestWriter.cxx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'package/source/manifest') diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx index e55127824fbe..824789294152 100644 --- a/package/source/manifest/ManifestWriter.cxx +++ b/package/source/manifest/ManifestWriter.cxx @@ -19,9 +19,10 @@ #include #include +#include #include #include -#include +#include #include #include #include @@ -51,20 +52,15 @@ ManifestWriter::~ManifestWriter() void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStream >& rStream, const Sequence< Sequence< PropertyValue > >& rSequence ) throw (RuntimeException) { - OUString sSaxWriter ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.xml.sax.Writer" ) ); - Reference < XActiveDataSource > xSource ( xFactory->createInstance ( sSaxWriter ), UNO_QUERY ); - if (xSource.is()) - { - xSource->setOutputStream ( rStream ); + Reference < XWriter > xSource = Writer::create( comphelper::getComponentContext(xFactory) ); + xSource->setOutputStream ( rStream ); + try { Reference < XDocumentHandler > xHandler ( xSource, UNO_QUERY ); - if (xHandler.is()) - try { - ManifestExport( xHandler, rSequence); - } - catch( SAXException& ) - { - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - } + ManifestExport( xHandler, rSequence); + } + catch( SAXException& ) + { + throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } } -- cgit