diff options
author | Mathias Bauer <mba@openoffice.org> | 2001-04-10 06:58:27 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2001-04-10 06:58:27 +0000 |
commit | a105df59af85b527be690b1f3fecae7ac183fcf0 (patch) | |
tree | 86f4716a3de0bc979a3281bb572f05f27a04ff81 /sot/source | |
parent | f3743f338110a62ef7a81f8a06538530fbcd2497 (diff) |
#85880#: seek stream to begin for copying it
Diffstat (limited to 'sot/source')
-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); |