summaryrefslogtreecommitdiff
path: root/svx/source/xml
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-10-04 16:58:04 +0000
committerKurt Zenker <kz@openoffice.org>2004-10-04 16:58:04 +0000
commit286afa0cdd959fb7169eb958fea07a099eab8efe (patch)
tree8a5aa6e552ec24a673cb23f776509fc1d18cdcbf /svx/source/xml
parent7594e6642a3c7c52a64e88c5ce2689d5d28383ae (diff)
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
Diffstat (limited to 'svx/source/xml')
-rw-r--r--svx/source/xml/xmlxtexp.cxx38
1 files changed, 17 insertions, 21 deletions
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 <com/sun/star/io/XActiveDataSource.hpp>
#endif
+#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_
+#include <com/sun/star/embed/ElementModes.hpp>
+#endif
#ifndef _SFXDOCFILE_HXX
#include <sfx2/docfile.hxx>
#endif
-#ifndef _SVSTOR_HXX
-#include <so3/svstor.hxx>
-#endif
#ifndef _RTL_USTRBUF_HXX_
#include <rtl/ustrbuf.hxx>
@@ -157,6 +157,8 @@
#include "xmlxtexp.hxx"
+#include <comphelper/storagehelper.hxx>
+
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<container::XNameContainer >& 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<io::XOutputStream> 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<io::XActiveDataSource> xMetaSrc( xWriter, uno::UNO_QUERY );
xMetaSrc->setOutputStream( xOut );