diff options
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index b9e658de9c41..1963b58837b8 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -319,7 +319,8 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM // copy the original stream into the temporary stream ( only transacted mode is supported ) if ( m_pSource->GetError() == ERRCODE_IO_NOTEXISTS ) m_pSource->ResetError(); - else { + else + { *m_pSource >> *m_pStream; m_pStream->Flush(); } @@ -387,7 +388,9 @@ void UCBStorageStream_Impl::SwitchToWritable( StreamMode nMode, BOOL bDirect ) // copy the original stream into the temporary stream ( only transacted mode is supported ) if ( m_pSource->GetError() == ERRCODE_IO_NOTEXISTS ) m_pSource->ResetError(); - else { + else + { + m_pSource->Seek(0); *m_pSource >> *m_pStream; m_pStream->Flush(); } @@ -526,7 +529,10 @@ BOOL UCBStorageStream_Impl::Revert() if ( !m_pSource ) // SourceStream was released on last Commit m_pSource = ::utl::UcbStreamHelper::CreateStream( m_aURL, STREAM_STD_READ ); + else + m_pSource->Seek(0); + m_pStream->Seek(0); *m_pSource >> *m_pStream; m_pStream->Seek(0); m_pSource->Seek(0); @@ -832,6 +838,7 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, BOOL // copy data into the temporary file m_pStream = ::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READWRITE ); + rStream.Seek(0); rStream >> *m_pStream; m_pStream->Flush(); DELETEZ( m_pStream ); @@ -1133,6 +1140,7 @@ sal_Int16 UCBStorage_Impl::Commit() if ( m_pSource != 0 ) { m_pStream = ::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ ); + m_pSource->Seek(0); *m_pStream >> *m_pSource; DELETEZ( m_pStream ); m_pSource->Seek(0); |