diff options
author | Mathias Bauer <mba@openoffice.org> | 2001-02-14 08:38:11 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2001-02-14 08:38:11 +0000 |
commit | e72739633550a6b05f217bc35d34af1dcf0cae0f (patch) | |
tree | b975375f1cb97a33f53a9fb79b980f5ba7bdbf9a /sot/source | |
parent | e86502362c7e7a4270add9ef9ff8841ebc35b18b (diff) |
better handling for non existing substorages
Diffstat (limited to 'sot/source')
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 5fe21413403c..1c78acaf9988 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1404,6 +1404,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM aName += '/'; aName += rEleName; UCBStorageStream* pStream = new UCBStorageStream( aName, nMode, bDirect ); + pStream->SetError( GetError() ); pStream->pImp->m_aName = rEleName; return pStream; } @@ -1486,7 +1487,16 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM { // element does not exist, check if creation is allowed if( ( nMode & STREAM_NOCREATE ) ) + { SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND ); + String aName( pImp->m_aURL ); + aName += '/'; + aName += rEleName; // ??? + UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, FALSE ); + pStorage->pImp->m_bIsRoot = FALSE; + pStorage->SetError( GetError() ); + return pStorage; + } // create a new UCBStorageElement and insert it into the list // problem: perhaps an OLEStorage should be created ?! |