From 286afa0cdd959fb7169eb958fea07a099eab8efe Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Mon, 4 Oct 2004 16:58:04 +0000 Subject: INTEGRATION: CWS mav09 (1.8.528); FILE MERGED 2004/08/09 17:54:33 mav 1.8.528.5: RESYNC: (1.9-1.10); FILE MERGED 2004/05/19 14:28:57 mav 1.8.528.4: #i27773# resolve resync problems 2004/05/17 20:59:04 mav 1.8.528.3: RESYNC: (1.8-1.9); FILE MERGED 2004/04/21 14:45:32 mba 1.8.528.2: #i27773#: new storage and embedding API 2004/04/14 14:11:23 mba 1.8.528.1: #i27773#: remove so3; new storage API --- svx/source/xml/xmlxtexp.cxx | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'svx/source/xml') diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index 344387399e38..43b26ec8e969 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlxtexp.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: rt $ $Date: 2004-07-13 07:51:55 $ + * last change: $Author: kz $ $Date: 2004-10-04 17:58:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,13 +87,13 @@ #ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_ #include #endif +#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_ +#include +#endif #ifndef _SFXDOCFILE_HXX #include #endif -#ifndef _SVSTOR_HXX -#include -#endif #ifndef _RTL_USTRBUF_HXX_ #include @@ -157,6 +157,8 @@ #include "xmlxtexp.hxx" +#include + using namespace com::sun::star; using namespace com::sun::star::container; using namespace com::sun::star::document; @@ -272,7 +274,7 @@ SvxXMLXTableExportComponent::~SvxXMLXTableExportComponent() sal_Bool SvxXMLXTableExportComponent::save( const OUString& rURL, const uno::Reference& xTable ) throw() { - SvStorageRef aStorage; + uno::Reference < embed::XStorage > xStorage; SfxMedium* pMedium = NULL; sal_Bool bRet = sal_False; @@ -283,15 +285,12 @@ sal_Bool SvxXMLXTableExportComponent::save( const OUString& rURL, const uno::Ref { do { - SvStorage* pStorage = NULL; - uno::Reference xOut; - - SvStorageStreamRef xStream; + uno::Reference < io::XOutputStream > xOut; + uno::Reference < io::XStream > xStream; sal_Bool bNeedStorage = xTable->getElementType() == ::getCppuType((const OUString*)0); uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); - if( !xServiceFactory.is() ) { DBG_ERROR( "got no service manager" ); @@ -299,7 +298,6 @@ sal_Bool SvxXMLXTableExportComponent::save( const OUString& rURL, const uno::Ref } uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ) ); - if( !xWriter.is() ) { DBG_ERROR( "com.sun.star.xml.sax.Writer service missing" ); @@ -310,22 +308,20 @@ sal_Bool SvxXMLXTableExportComponent::save( const OUString& rURL, const uno::Ref if( bNeedStorage ) { - pStorage = new SvStorage( sal_True, rURL, STREAM_WRITE | STREAM_TRUNC, 0 ); - aStorage = pStorage; + xStorage = + ::comphelper::OStorageHelper::GetStorageFromURL( rURL, embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ); - if( NULL == pStorage ) + if( !xStorage.is() ) { DBG_ERROR( "no storage!" ); break; } OUString sMetaName( RTL_CONSTASCII_USTRINGPARAM( "Content.xml" ) ); - xStream = pStorage->OpenStream( sMetaName, STREAM_WRITE | STREAM_SHARE_DENYWRITE ); - xStream->SetBufferSize( 16*1024 ); - - pGraphicHelper = SvXMLGraphicHelper::Create( *pStorage, GRAPHICHELPER_MODE_WRITE ); + xStream = xStorage->openStreamElement( sMetaName, embed::ElementModes::WRITE ); + pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE ); xGrfResolver = pGraphicHelper; - xOut = new utl::OOutputStreamWrapper( *xStream ); + xOut = xStream->getOutputStream(); } else { @@ -338,10 +334,10 @@ sal_Bool SvxXMLXTableExportComponent::save( const OUString& rURL, const uno::Ref DBG_ERROR( "no output stream!" ); break; } + xOut = new utl::OOutputStreamWrapper( *pStream ); } - uno::Reference xMetaSrc( xWriter, uno::UNO_QUERY ); xMetaSrc->setOutputStream( xOut ); -- cgit