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 /filter/source/svg | |
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 'filter/source/svg')
-rw-r--r-- | filter/source/svg/svgexport.cxx | 23 | ||||
-rw-r--r-- | filter/source/svg/svgfilter.hxx | 3 |
2 files changed, 9 insertions, 17 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 686cb5138f65..2013fff563bd 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/util/MeasureUnit.hpp> #include <com/sun/star/text/textfield/Type.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <rtl/bootstrap.hxx> #include <svtools/miscopt.hxx> @@ -639,7 +640,7 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) { if( mSelectedPages.hasElements() && mMasterPageTargets.hasElements() ) { - Reference< XDocumentHandler > xDocHandler( implCreateExportDocumentHandler( xOStm ) ); + Reference< XDocumentHandler > xDocHandler( implCreateExportDocumentHandler( xOStm ), UNO_QUERY ); if( xDocHandler.is() ) { @@ -714,24 +715,14 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) // ----------------------------------------------------------------------------- -Reference< XDocumentHandler > SVGFilter::implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm ) +Reference< XWriter > SVGFilter::implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm ) { - Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - Reference< XDocumentHandler > xSaxWriter; + Reference< XWriter > xSaxWriter; - if( xMgr.is() && rxOStm.is() ) + if( rxOStm.is() ) { - xSaxWriter = Reference< XDocumentHandler >( xMgr->createInstance( B2UCONST( "com.sun.star.xml.sax.Writer" ) ), UNO_QUERY ); - - if( xSaxWriter.is() ) - { - Reference< XActiveDataSource > xActiveDataSource( xSaxWriter, UNO_QUERY ); - - if( xActiveDataSource.is() ) - xActiveDataSource->setOutputStream( rxOStm ); - else - xSaxWriter = NULL; - } + xSaxWriter = Writer::create( ::comphelper::getProcessComponentContext() ); + xSaxWriter->setOutputStream( rxOStm ); } return xSaxWriter; diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index c5567dfe7de1..9624614c26f3 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -50,6 +50,7 @@ #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <com/sun/star/xml/sax/XWriter.hpp> #include <boost/unordered_set.hpp> #include <boost/unordered_map.hpp> @@ -308,7 +309,7 @@ private: sal_Bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException); sal_Bool implExport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException); - Reference< XDocumentHandler > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm ); + Reference< XWriter > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm ); sal_Bool implGetPagePropSet( const Reference< XDrawPage > & rxPage ); sal_Bool implGenerateMetaData(); |