summaryrefslogtreecommitdiff
path: root/unotools
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 /unotools
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 'unotools')
-rw-r--r--unotools/source/config/accelcfg.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/unotools/source/config/accelcfg.cxx b/unotools/source/config/accelcfg.cxx
index e3f121ca142f..9c48b7f5e06e 100644
--- a/unotools/source/config/accelcfg.cxx
+++ b/unotools/source/config/accelcfg.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
+#include <com/sun/star/xml/sax/Writer.hpp>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
@@ -88,16 +89,12 @@ SvtAcceleratorConfig_Impl::SvtAcceleratorConfig_Impl( Reference< XInputStream >&
bool SvtAcceleratorConfig_Impl::Commit( Reference< XOutputStream >& rOutputStream )
{
- Reference< XDocumentHandler > xWriter;
+ Reference< XWriter > xWriter = Writer::create( ::comphelper::getProcessComponentContext() );
- xWriter = Reference< XDocumentHandler >( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString("com.sun.star.xml.sax.Writer")), UNO_QUERY) ;
-
- Reference< ::com::sun::star::io::XActiveDataSource> xDataSource( xWriter , UNO_QUERY );
- xDataSource->setOutputStream( rOutputStream );
+ xWriter->setOutputStream( rOutputStream );
try
{
- OWriteAccelatorDocumentHandler aWriteHandler( aList, xWriter );
+ OWriteAccelatorDocumentHandler aWriteHandler( aList, Reference<XDocumentHandler>(xWriter, UNO_QUERY_THROW) );
aWriteHandler.WriteAcceleratorDocument();
rOutputStream->flush();
return true;