summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-05-07 10:37:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-05-07 11:05:06 +0200
commit8a91528a3e03fe6e2923c33327b687ecf57adb0b (patch)
tree8accfb0b9345883155b56eab4721b0773fa3a930 /sot
parentbd9f5783abe2ed807c3c70a60e5e00b5d117d820 (diff)
StorageMode::CreateUnpacked is never used
Change-Id: I7285c90c82b04e3ebb2db371b675689de9c183d7
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/storage.cxx91
1 files changed, 36 insertions, 55 deletions
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index caa6c2e34d63..9dd9e32442dd 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -360,74 +360,55 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
m_aName = aObj.GetMainURL( INetURLObject::NO_DECODE );
}
- // a new unpacked storage should be created
- if ( nStorageMode == StorageMode::CreateUnpacked )
- {
- // don't open stream readwrite, content provider may not support this !
- OUString aURL = UCBStorage::CreateLinkFile( m_aName );
- if ( !aURL.isEmpty() )
- {
- ::ucbhelper::Content aContent( aURL, ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
- m_pOwnStg = new UCBStorage( aContent, aURL, nMode, false );
- }
- else
- {
- m_pOwnStg = new Storage( m_aName, nMode, false );
- SetError( ERRCODE_IO_NOTSUPPORTED );
- }
- }
- else
+ // check the stream
+ m_pStorStm = ::utl::UcbStreamHelper::CreateStream( m_aName, nMode );
+ if ( m_pStorStm && m_pStorStm->GetError() )
+ DELETEZ( m_pStorStm );
+
+ if ( m_pStorStm )
{
- // check the stream
- m_pStorStm = ::utl::UcbStreamHelper::CreateStream( m_aName, nMode );
- if ( m_pStorStm && m_pStorStm->GetError() )
- DELETEZ( m_pStorStm );
+ // try as UCBStorage, next try as OLEStorage
+ bool bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm );
+ if ( !bIsUCBStorage && bForceUCBStorage )
+ // if UCBStorage has priority, it should not be used only if it is really an OLEStorage
+ bIsUCBStorage = !Storage::IsStorageFile( m_pStorStm );
- if ( m_pStorStm )
+ if ( bIsUCBStorage )
{
- // try as UCBStorage, next try as OLEStorage
- bool bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm );
- if ( !bIsUCBStorage && bForceUCBStorage )
- // if UCBStorage has priority, it should not be used only if it is really an OLEStorage
- bIsUCBStorage = !Storage::IsStorageFile( m_pStorStm );
-
- if ( bIsUCBStorage )
+ if ( !(UCBStorage::GetLinkedFile( *m_pStorStm ).isEmpty()) )
{
- if ( !(UCBStorage::GetLinkedFile( *m_pStorStm ).isEmpty()) )
- {
- // detect special unpacked storages
- m_pOwnStg = new UCBStorage( *m_pStorStm, !(nStorageMode & StorageMode::Transacted) );
- m_bDelStm = true;
- }
- else
- {
- // detect special disk spanned storages
- if ( UCBStorage::IsDiskSpannedFile( m_pStorStm ) )
- nStorageMode |= StorageMode::DiskspannedMode;
-
- // UCBStorage always works directly on the UCB content, so discard the stream first
- DELETEZ( m_pStorStm );
- m_pOwnStg = new UCBStorage( m_aName, nMode, !(nStorageMode & StorageMode::Transacted) );
- }
+ // detect special unpacked storages
+ m_pOwnStg = new UCBStorage( *m_pStorStm, !(nStorageMode & StorageMode::Transacted) );
+ m_bDelStm = true;
}
else
{
- // OLEStorage can be opened with a stream
- m_pOwnStg = new Storage( *m_pStorStm, !(nStorageMode & StorageMode::Transacted) );
- m_bDelStm = true;
+ // detect special disk spanned storages
+ if ( UCBStorage::IsDiskSpannedFile( m_pStorStm ) )
+ nStorageMode |= StorageMode::DiskspannedMode;
+
+ // UCBStorage always works directly on the UCB content, so discard the stream first
+ DELETEZ( m_pStorStm );
+ m_pOwnStg = new UCBStorage( m_aName, nMode, !(nStorageMode & StorageMode::Transacted) );
}
}
- else if ( bForceUCBStorage )
- {
- m_pOwnStg = new UCBStorage( m_aName, nMode, !(nStorageMode & StorageMode::Transacted) );
- SetError( ERRCODE_IO_NOTSUPPORTED );
- }
else
{
- m_pOwnStg = new Storage( m_aName, nMode, !(nStorageMode & StorageMode::Transacted) );
- SetError( ERRCODE_IO_NOTSUPPORTED );
+ // OLEStorage can be opened with a stream
+ m_pOwnStg = new Storage( *m_pStorStm, !(nStorageMode & StorageMode::Transacted) );
+ m_bDelStm = true;
}
}
+ else if ( bForceUCBStorage )
+ {
+ m_pOwnStg = new UCBStorage( m_aName, nMode, !(nStorageMode & StorageMode::Transacted) );
+ SetError( ERRCODE_IO_NOTSUPPORTED );
+ }
+ else
+ {
+ m_pOwnStg = new Storage( m_aName, nMode, !(nStorageMode & StorageMode::Transacted) );
+ SetError( ERRCODE_IO_NOTSUPPORTED );
+ }
}
else
{