diff options
author | Mathias Bauer <mba@openoffice.org> | 2002-10-22 14:19:13 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2002-10-22 14:19:13 +0000 |
commit | 272cc850fd3d07dc4872218131444f622b832e66 (patch) | |
tree | 1b9421ad0125cd92f94b30145a1c5991e22c22e8 /sot | |
parent | #103442# choose DefDialogParent on-the-fly (diff) | |
download | core-272cc850fd3d07dc4872218131444f622b832e66.tar.gz core-272cc850fd3d07dc4872218131444f622b832e66.zip |
#104328#: avoid error when checking for a storage on streams less than the minimum size
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 8 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index e663de84e161..0ae7f835d91b 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: stg.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: mba $ $Date: 2001-11-13 10:31:51 $ + * last change: $Author: mba $ $Date: 2002-10-22 15:19:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -384,6 +384,10 @@ BOOL Storage::IsStorageFile( SvStream* pStream ) StgHeader aHdr; ULONG nPos = pStream->Tell(); BOOL bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); + + // It's not a stream error if it is too small for a OLE storage header + if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK ) + pStream->ResetError(); pStream->Seek( nPos ); return bRet; } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 3d4bd1589c24..36c73b990363 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ucbstorage.cxx,v $ * - * $Revision: 1.75 $ + * $Revision: 1.76 $ * - * last change: $Author: mav $ $Date: 2002-10-21 08:02:45 $ + * last change: $Author: mba $ $Date: 2002-10-22 15:19:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3197,7 +3197,7 @@ BOOL UCBStorage::IsStorageFile( SvStream* pFile ) ULONG nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); - if ( !pFile->Tell() ) + if ( pFile->Tell() < 4 ) return FALSE; pFile->Seek(0); |