diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2010-03-23 13:00:11 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2010-03-23 13:00:11 +0100 |
commit | 682a87732c864ee15ca2c6be10d2aa655936c93d (patch) | |
tree | 3492a17701b4fa884652c549204970bb0b19267a /package/source/xstor/xstorage.cxx | |
parent | 94bf193db97db0d4ccf6491f8886fdca44e4b252 (diff) |
fwk138: #i87496# publish services, interfaces and etc.
Diffstat (limited to 'package/source/xstor/xstorage.cxx')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 153 |
1 files changed, 77 insertions, 76 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 55ff5a87e78d..6926f192534a 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/UseBackupException.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -124,13 +125,13 @@ void OStorage_Impl::completeStorageStreamCopy_Impl( uno::Sequence< ::rtl::OUString > aPropNames( 1 ); aPropNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ); - if ( nStorageType == PACKAGE_STORAGE ) + if ( nStorageType == embed::StorageFormats::PACKAGE ) { aPropNames.realloc( 3 ); aPropNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); aPropNames[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); } - else if ( nStorageType == OFOPXML_STORAGE ) + else if ( nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: in future it might make sence to provide the stream if there is one uno::Reference< embed::XRelationshipAccess > xRelAccess( xDest, uno::UNO_QUERY_THROW ); @@ -356,7 +357,7 @@ OStorage_Impl::~OStorage_Impl() m_aDeletedList.clear(); - if ( m_nStorageType == OFOPXML_STORAGE && m_pRelStorElement ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_pRelStorElement ) { delete m_pRelStorElement; m_pRelStorElement = NULL; @@ -500,7 +501,7 @@ void OStorage_Impl::OpenOwnPackage() } } - if ( m_nStorageType == ZIP_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::ZIP ) { // let the package support only plain zip format beans::NamedValue aNamedValue; @@ -509,7 +510,7 @@ void OStorage_Impl::OpenOwnPackage() aArguments.realloc( ++nArgNum ); aArguments[nArgNum-1] <<= aNamedValue; } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // let the package support OFOPXML media type handling beans::NamedValue aNamedValue; @@ -562,7 +563,7 @@ SotElementList_Impl& OStorage_Impl::GetChildrenList() //----------------------------------------------- void OStorage_Impl::GetStorageProperties() { - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { uno::Reference< beans::XPropertySet > xProps( m_xPackageFolder, uno::UNO_QUERY_THROW ); @@ -588,7 +589,7 @@ void OStorage_Impl::GetStorageProperties() //----------------------------------------------- void OStorage_Impl::ReadRelInfoIfNecessary() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( m_nRelInfoStatus == RELINFO_NO_INIT ) @@ -662,7 +663,7 @@ void OStorage_Impl::ReadContents() uno::Reference< container::XNameContainer > xNameContainer( xNamed, uno::UNO_QUERY ); SotElement_Impl* pNewElement = new SotElement_Impl( aName, xNameContainer.is(), sal_False ); - if ( m_nStorageType == OFOPXML_STORAGE && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) { if ( !pNewElement->m_bIsStorage ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Unexpected format @@ -730,7 +731,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } // move storage properties to the destination one ( means changeable properties ) - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { ::rtl::OUString aMediaTypeString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); ::rtl::OUString aVersionString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ); @@ -738,7 +739,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes xPropSet->setPropertyValue( aVersionString, uno::makeAny( m_aVersion ) ); } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { // if this is a root storage, the common key from current one should be moved there sal_Bool bIsRoot = sal_False; @@ -759,7 +760,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } } } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: currently the optimization is not active @@ -850,13 +851,13 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, } } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { aStrProps.realloc( ++nNum ); aStrProps[nNum-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); aStrProps[nNum-1].Value <<= (sal_Bool)( pElement->m_pStream->UsesCommonPass_Impl() ); } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: currently the optimization is not active // uno::Reference< io::XInputStream > xInStream = GetRelInfoStreamForName( ::rtl::OUString() ); // own rels stream @@ -907,7 +908,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, pElement->m_pStream->CopyInternallyTo_Impl( xSubStr ); } } - else if ( m_nStorageType != PACKAGE_STORAGE ) + else if ( m_nStorageType != embed::StorageFormats::PACKAGE ) { OSL_ENSURE( sal_False, "Encryption is only supported in package storage!\n" ); throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -994,7 +995,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, //----------------------------------------------- uno::Sequence< uno::Sequence< beans::StringPair > > OStorage_Impl::GetAllRelationshipsIfAny() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); @@ -1088,7 +1089,7 @@ void OStorage_Impl::Commit() pDeletedIter++ ) { - if ( m_nStorageType == OFOPXML_STORAGE && !(*pDeletedIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pDeletedIter)->m_bIsStorage ) RemoveStreamRelInfo( (*pDeletedIter)->m_aOriginalName ); // the removed elements are not in new temporary storage @@ -1108,7 +1109,7 @@ void OStorage_Impl::Commit() if ( (*pElementIter)->m_bIsRemoved ) { - if ( m_nStorageType == OFOPXML_STORAGE && !(*pElementIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pElementIter)->m_bIsStorage ) RemoveStreamRelInfo( (*pElementIter)->m_aOriginalName ); // the removed elements are not in new temporary storage @@ -1158,7 +1159,7 @@ void OStorage_Impl::Commit() } else if ( !(*pElementIter)->m_bIsStorage && (*pElementIter)->m_pStream && (*pElementIter)->m_pStream->m_bFlushed ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitStreamRelInfo( *pElementIter ); // the renamed elements are not in new temporary storage @@ -1184,7 +1185,7 @@ void OStorage_Impl::Commit() xNewPackageFolder->removeByName( (*pElementIter)->m_aOriginalName ); xNewPackageFolder->insertByName( (*pElementIter)->m_aName, aPackageElement ); - if ( m_nStorageType == OFOPXML_STORAGE && !(*pElementIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pElementIter)->m_bIsStorage ) { if ( !(*pElementIter)->m_pStream ) { @@ -1233,7 +1234,7 @@ void OStorage_Impl::Commit() if ( (*pElementIter)->m_pStream->m_bFlushed ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitStreamRelInfo( *pElementIter ); (*pElementIter)->m_pStream->InsertIntoPackageFolder( (*pElementIter)->m_aName, xNewPackageFolder ); @@ -1244,7 +1245,7 @@ void OStorage_Impl::Commit() } } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { // move properties to the destination package folder uno::Reference< beans::XPropertySet > xProps( xNewPackageFolder, uno::UNO_QUERY ); @@ -1255,7 +1256,7 @@ void OStorage_Impl::Commit() xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), uno::makeAny( m_aVersion ) ); } - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitRelInfo( xNewPackageFolder ); // store own relations and commit complete relations storage if ( m_bIsRoot ) @@ -1349,7 +1350,7 @@ void OStorage_Impl::Revert() GetStorageProperties(); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // currently the relations storage is changed only on commit m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -1364,7 +1365,7 @@ void OStorage_Impl::Revert() { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( m_bIsRoot ) @@ -1422,8 +1423,8 @@ SotElement_Impl* OStorage_Impl::InsertStream( ::rtl::OUString aName, sal_Bool bE if ( !xPackageSubStream.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE || !bEncr, "Only package storage supports encryption!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE && bEncr ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE || !bEncr, "Only package storage supports encryption!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE && bEncr ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the mode is not needed for storage stream internal implementation @@ -1445,7 +1446,7 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( ::rtl::OUString aName, const un if ( !m_xPackage.is() ) throw embed::InvalidStorageException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY ); @@ -1726,7 +1727,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) // this method should be used only in OStorage_Impl::Commit() method // the aOriginalName can be empty, in this case the storage relation info should be removed - if ( m_nStorageType == OFOPXML_STORAGE && m_xRelStorage.is() ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_xRelStorage.is() ) { ::rtl::OUString aRelStreamName = aOriginalName; aRelStreamName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".rels" ) ); @@ -1739,7 +1740,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) //----------------------------------------------- void OStorage_Impl::CreateRelStorage() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( !m_xRelStorage.is() ) @@ -1772,7 +1773,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) if ( !pStreamElement ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType == OFOPXML_STORAGE && pStreamElement->m_pStream ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && pStreamElement->m_pStream ) { OSL_ENSURE( pStreamElement->m_aName.getLength(), "The name must not be empty!\n" ); @@ -1789,7 +1790,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) //----------------------------------------------- uno::Reference< io::XInputStream > OStorage_Impl::GetRelInfoStreamForName( const ::rtl::OUString& aName ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { ReadContents(); if ( m_xRelStorage.is() ) @@ -1817,7 +1818,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain if ( !xNewPackageFolder.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -2259,7 +2260,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( m_pData->m_bIsRoot ) { @@ -2275,7 +2276,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) , static_cast<embed::XStorageRawAccess*> ( this ) ); } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -2314,7 +2315,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() if ( m_pData->m_pTypeCollection == NULL ) { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( m_pData->m_bIsRoot ) { @@ -2340,7 +2341,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2482,7 +2483,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name @@ -2583,7 +2584,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) @@ -2693,7 +2694,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( if ( !aStorName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -2848,7 +2849,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const ::rtl if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -2930,7 +2931,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( !aPass.getLength() ) @@ -3087,7 +3088,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !aStorName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -3181,7 +3182,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const ::rtl::OUString& aElementName if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name @@ -3250,7 +3251,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const ::rtl::OUString& aElementNam if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); @@ -3323,7 +3324,7 @@ void SAL_CALL OStorage::removeElement( const ::rtl::OUString& aElementName ) if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name @@ -3418,7 +3419,7 @@ void SAL_CALL OStorage::renameElement( const ::rtl::OUString& aElementName, cons || !aNewName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // TODO: unacceptable element name @@ -3529,7 +3530,7 @@ void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, // || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name @@ -3633,7 +3634,7 @@ void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name @@ -3743,7 +3744,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface is not supported and must not be accessible if ( !sStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) @@ -3853,7 +3854,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !sStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) @@ -3973,7 +3974,7 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const ::rtl::OUString& aStre throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) @@ -4334,7 +4335,7 @@ uno::Any SAL_CALL OStorage::getByName( const ::rtl::OUString& aName ) if ( !aName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name @@ -4439,7 +4440,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const ::rtl::OUString& aName ) if ( !aName.getLength() ) return sal_False; - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) return sal_False; @@ -4616,7 +4617,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage OSL_ENSURE( m_pData->m_bIsRoot, "setEncryptionPassword() method is not available for nonroot storages!\n" ); @@ -4682,7 +4683,7 @@ void SAL_CALL OStorage::removeEncryption() throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage OSL_ENSURE( m_pData->m_bIsRoot, "removeEncryption() method is not available for nonroot storages!\n" ); @@ -4783,9 +4784,9 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, if ( m_pData->m_bReadOnlyWrap && !aPropertyName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Access denied - if ( m_pData->m_nStorageType == ZIP_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( aPropertyName.equalsAscii( "MediaType" ) ) { @@ -4818,7 +4819,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, else throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( aPropertyName.equalsAscii( "RelationsInfoStream" ) ) { @@ -4885,7 +4886,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType == PACKAGE_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "MediaType" ) || aPropertyName.equalsAscii( "MediaTypeFallbackUsed" ) || aPropertyName.equalsAscii( "Version" ) ) ) @@ -4943,7 +4944,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa return uno::makeAny( sal_False ); // RepairPackage } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) || aPropertyName.equalsAscii( "IsInconsistent" ) ) ) @@ -5078,7 +5079,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); try @@ -5109,7 +5110,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -5134,7 +5135,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -5159,7 +5160,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: in future the unification of the ID could be checked @@ -5189,7 +5190,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -5225,7 +5226,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRel throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return m_pImpl->GetAllRelationshipsIfAny(); @@ -5245,7 +5246,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const ::rtl::OUString& sID, con throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -5310,7 +5311,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5352,7 +5353,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -5434,7 +5435,7 @@ void SAL_CALL OStorage::clearRelationships() throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); m_pImpl->m_aRelInfo.realloc( 0 ); @@ -5487,7 +5488,7 @@ void SAL_CALL OStorage::insertStreamElementDirect( if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -5584,7 +5585,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo( if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable name @@ -5840,7 +5841,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name @@ -5851,7 +5852,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: Currently it is only implemented for MediaType property of substorages, might be changed in future - if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != PACKAGE_STORAGE || !aPropertyName.equalsAscii( "MediaType" ) ) + if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != embed::StorageFormats::PACKAGE || !aPropertyName.equalsAscii( "MediaType" ) ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStorage ) @@ -5943,7 +5944,7 @@ void SAL_CALL OStorage::copyStreamElementData( const ::rtl::OUString& aStreamNam if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name @@ -6090,7 +6091,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !aStreamPath.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) ) |