diff options
author | Michael Brauer <mib@openoffice.org> | 2000-12-02 08:21:34 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2000-12-02 08:21:34 +0000 |
commit | 36ca059d004b174bb12485a1673b6273302138fb (patch) | |
tree | 827c62b169b87cb20521a1b011c153cc4d4b52ca /svx/source/xml | |
parent | 20992faac3e408324e706b0d491378fe0854e224 (diff) |
#80795#: Use UCB storages and commit them
Diffstat (limited to 'svx/source/xml')
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 9768c1fd6a65..8d9e60498663 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlgrhlp.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ + * last change: $Author: mib $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -135,7 +135,11 @@ sal_Bool SvXMLGraphicHelper::ImplGetStreamNames( const ::rtl::OUString& rURLStr, SvStorageRef SvXMLGraphicHelper::ImplGetGraphicStorage( const ::rtl::OUString& rStorageName ) { if( !mxGraphicStorage.Is() || ( rStorageName != maCurStorageName ) ) - mxGraphicStorage = mpRootStorage->OpenStorage( maCurStorageName = rStorageName, STREAM_READ | STREAM_WRITE ); + { + if( mxGraphicStorage.Is() && GRAPHICHELPER_MODE_WRITE == meCreateMode ) + mxGraphicStorage->Commit(); + mxGraphicStorage = mpRootStorage->OpenUCBStorage( maCurStorageName = rStorageName, STREAM_READ | STREAM_WRITE ); + } return mxGraphicStorage; } @@ -210,6 +214,7 @@ void SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureStorag else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE ) ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( *xStm ); } + xStm->Commit(); } } } @@ -296,6 +301,14 @@ void SvXMLGraphicHelper::Flush() ImplWriteGraphic( aPictureStorageName, aPictureStreamName ); } } + if( GRAPHICHELPER_MODE_WRITE == meCreateMode ) + { + SvStorageRef xStorage = ImplGetGraphicStorage( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(XML_GRAPHICSTORAGE_NAME) ) ); + if( xStorage.Is() ) + xStorage->Commit(); + } + } // ----------------------------------------------------------------------------- |