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 /reportdesign | |
parent | CLANGPLUGIN_CPPFLAGS for building plugin for Clang in nonstandard location (diff) | |
download | core-fb741b5e1e6aeaee74cf14af4f1cc152f0ab0952.tar.gz core-fb741b5e1e6aeaee74cf14af4f1cc152f0ab0952.zip |
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 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index df133d7d816d..e5840ccaeff7 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -73,7 +73,7 @@ #include <com/sun/star/task/XStatusIndicatorFactory.hpp> #include <com/sun/star/ui/XUIConfigurationStorage.hpp> #include <com/sun/star/xml/AttributeData.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <comphelper/broadcasthelper.hxx> #include <comphelper/documentconstants.hxx> @@ -1738,20 +1738,15 @@ sal_Bool OReportDefinition::WriteThroughComponent( OSL_ENSURE( NULL != pServiceName, "Need component name!" ); // get component - uno::Reference< io::XActiveDataSource > xSaxWriter( - m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")),m_aProps->m_xContext), - uno::UNO_QUERY ); - OSL_ENSURE( xSaxWriter.is(), "can't instantiate XML com.sun.star.xml.sax.Writer" ); - if(!xSaxWriter.is()) - return sal_False; + uno::Reference< xml::sax::XWriter > xSaxWriter( + xml::sax::Writer::create(m_aProps->m_xContext) ); // connect XML writer to output stream xSaxWriter->setOutputStream( xOutputStream ); // prepare arguments (prepend doc handler to given arguments) - uno::Reference<xml::sax::XDocumentHandler> xDocHandler( xSaxWriter,uno::UNO_QUERY); uno::Sequence<uno::Any> aArgs( 1 + rArguments.getLength() ); - aArgs[0] <<= xDocHandler; + aArgs[0] <<= xSaxWriter; for(sal_Int32 i = 0; i < rArguments.getLength(); i++) aArgs[i+1] = rArguments[i]; |