diff options
author | Mathias Bauer <mba@openoffice.org> | 2000-12-04 10:10:03 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2000-12-04 10:10:03 +0000 |
commit | 9835c016ab97ac34444afe832304d6e72a569950 (patch) | |
tree | 9540587fd5ebc661e4eb523c5b4bb4d49c9bb68a /sot | |
parent | c421b0816cfb9fd0f3c0ae2afd4450ba6e486c6a (diff) |
#80466#: IsStorage now preserves file position
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index f5f2f10d702c..21e52fd26611 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: stg.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mba $ $Date: 2000-11-30 08:54:59 $ + * last change: $Author: mba $ $Date: 2000-12-04 11:10:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -382,7 +382,10 @@ BOOL Storage::IsStorageFile( const String & rFileName ) BOOL Storage::IsStorageFile( SvStream* pStream ) { StgHeader aHdr; - return ( pStream && aHdr.Load( *pStream ) && aHdr.Check() ); + ULONG nPos = pStream->Tell(); + BOOL bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); + pStream->Seek( nPos ); + return bRet; } // Open the storage file. If writing is permitted and the file is not @@ -653,7 +656,7 @@ BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, BOOL } StorageStream* pStm = new StorageStream( pIo, p, m ); if( p && !p->bDirect ) - pStm->bAutoCommit = TRUE; + pStm->SetAutoCommit( TRUE ); pIo->MoveError( *pStm ); return pStm; } |