summaryrefslogtreecommitdiff
path: root/package/source
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 /package/source
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 'package/source')
-rw-r--r--package/source/manifest/ManifestWriter.cxx24
-rw-r--r--package/source/xstor/owriteablestream.cxx2
-rw-r--r--package/source/xstor/xstorage.cxx2
-rw-r--r--package/source/zippackage/ZipPackage.cxx2
4 files changed, 13 insertions, 17 deletions
diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx
index e55127824fbe..824789294152 100644
--- a/package/source/manifest/ManifestWriter.cxx
+++ b/package/source/manifest/ManifestWriter.cxx
@@ -19,9 +19,10 @@
#include <ManifestWriter.hxx>
#include <ManifestExport.hxx>
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/xml/sax/SAXException.hpp>
@@ -51,20 +52,15 @@ ManifestWriter::~ManifestWriter()
void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStream >& rStream, const Sequence< Sequence< PropertyValue > >& rSequence )
throw (RuntimeException)
{
- OUString sSaxWriter ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.xml.sax.Writer" ) );
- Reference < XActiveDataSource > xSource ( xFactory->createInstance ( sSaxWriter ), UNO_QUERY );
- if (xSource.is())
- {
- xSource->setOutputStream ( rStream );
+ Reference < XWriter > xSource = Writer::create( comphelper::getComponentContext(xFactory) );
+ xSource->setOutputStream ( rStream );
+ try {
Reference < XDocumentHandler > xHandler ( xSource, UNO_QUERY );
- if (xHandler.is())
- try {
- ManifestExport( xHandler, rSequence);
- }
- catch( SAXException& )
- {
- throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
- }
+ ManifestExport( xHandler, rSequence);
+ }
+ catch( SAXException& )
+ {
+ throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
}
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 05a3f158fee3..0ed7c8e7374d 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -1692,7 +1692,7 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora
if ( !xOutStream.is() )
throw uno::RuntimeException();
- ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aNewRelInfo, m_xFactory );
+ ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aNewRelInfo, comphelper::getComponentContext(m_xFactory) );
// set the mediatype
uno::Reference< beans::XPropertySet > xPropSet( xRelsStream, uno::UNO_QUERY_THROW );
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index a8acbdcf562a..478df445d8a9 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -1845,7 +1845,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain
if ( !xOutStream.is() )
throw uno::RuntimeException( OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
- ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aRelInfo, m_xFactory );
+ ::comphelper::OFOPXMLHelper::WriteRelationsInfoSequence( xOutStream, m_aRelInfo, comphelper::getComponentContext(m_xFactory) );
// set the mediatype
uno::Reference< beans::XPropertySet > xPropSet( xRelsStream, uno::UNO_QUERY_THROW );
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 5ab16b3dfa45..822f8399ea35 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1104,7 +1104,7 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno:
aOverridesSequence.realloc( nSeqLength );
::comphelper::OFOPXMLHelper::WriteContentSequence(
- xConTypeOutStream, aDefaultsSequence, aOverridesSequence, m_xFactory );
+ xConTypeOutStream, aDefaultsSequence, aOverridesSequence, comphelper::getComponentContext(m_xFactory) );
sal_Int32 nBufferLength = static_cast < sal_Int32 > ( pBuffer->getPosition() );
pBuffer->realloc( nBufferLength );