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 /linguistic | |
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 'linguistic')
-rw-r--r-- | linguistic/source/convdic.cxx | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 9a14901cc697..ed7a9c5a98b6 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -48,7 +48,7 @@ #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> @@ -261,21 +261,9 @@ void ConvDic::Save() SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); // get XML writer - uno::Reference< io::XActiveDataSource > xSaxWriter; - if (xServiceFactory.is()) - { - try - { - xSaxWriter = uno::Reference< io::XActiveDataSource >( - xServiceFactory->createInstance( "com.sun.star.xml.sax.Writer" ), UNO_QUERY ); - } - catch (uno::Exception &) - { - } - } - DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" ); + uno::Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(xContext); - if (xSaxWriter.is() && xStream.is()) + if (xStream.is()) { // connect XML writer to output stream xSaxWriter->setOutputStream( xStream->getOutputStream() ); |