summaryrefslogtreecommitdiff
path: root/framework/source/fwe/xml/menuconfiguration.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-16 09:45:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-23 17:44:16 +0200
commitb493b5a284d5a629d16e733197c7840fb33b469c (patch)
treec863a4e06843816bd1669dcfccfcf809b943a1f3 /framework/source/fwe/xml/menuconfiguration.cxx
parent6a40553095d71ce8a884a08563d3b3764c41ce65 (diff)
fdo#46808, use service constructor for xml::sax::Writer
Change-Id: I2b216a0e3a9694568642e9de2f4f43ecd682555f
Diffstat (limited to 'framework/source/fwe/xml/menuconfiguration.cxx')
-rw-r--r--framework/source/fwe/xml/menuconfiguration.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/framework/source/fwe/xml/menuconfiguration.cxx b/framework/source/fwe/xml/menuconfiguration.cxx
index c47e52d226aa..e5a59220ae61 100644
--- a/framework/source/fwe/xml/menuconfiguration.cxx
+++ b/framework/source/fwe/xml/menuconfiguration.cxx
@@ -37,6 +37,7 @@
#include <uielement/rootitemcontainer.hxx>
#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/frame/XFrame.hpp>
#include <comphelper/processfactory.hxx>
@@ -129,17 +130,13 @@ void MenuConfiguration::StoreMenuBarConfigurationToXML(
Reference< XOutputStream >& rOutputStream )
throw ( WrappedTargetException )
{
- Reference< XDocumentHandler > xWriter;
-
- xWriter = Reference< XDocumentHandler >( m_rxServiceManager->createInstance(
- SERVICENAME_SAXWRITER), UNO_QUERY) ;
-
- Reference< XActiveDataSource> xDataSource( xWriter , UNO_QUERY );
- xDataSource->setOutputStream( rOutputStream );
+ Reference< XWriter > xWriter = Writer::create(comphelper::getComponentContext(m_rxServiceManager));
+ xWriter->setOutputStream( rOutputStream );
try
{
- OWriteMenuDocumentHandler aWriteMenuDocumentHandler( rMenuBarConfiguration, xWriter );
+ Reference< XDocumentHandler > xHandler(xWriter, UNO_QUERY_THROW);
+ OWriteMenuDocumentHandler aWriteMenuDocumentHandler( rMenuBarConfiguration, xHandler );
aWriteMenuDocumentHandler.WriteMenuDocument();
}
catch ( const RuntimeException& e )