summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authoros <os@openoffice.org>2010-06-04 16:00:27 +0200
committeros <os@openoffice.org>2010-06-04 16:00:27 +0200
commit9b18e77bef76c249e93e1d6ae3ec7daa88ee3ad6 (patch)
tree724fe38d7617b69a5cf0ad3100037344410b9fcd /package
parente54b404ddf28f7f1945759856ef77546140b0276 (diff)
parentd0520c036f295a90d1877e285998a02d514f856a (diff)
rebase to m80
Diffstat (limited to 'package')
-rw-r--r--package/inc/PackageConstants.hxx4
-rw-r--r--package/inc/ZipPackage.hxx4
-rw-r--r--package/inc/ZipPackageFolder.hxx6
-rw-r--r--package/source/xstor/ocompinstream.cxx27
-rw-r--r--package/source/xstor/ocompinstream.hxx6
-rw-r--r--package/source/xstor/oseekinstream.cxx4
-rw-r--r--package/source/xstor/oseekinstream.hxx4
-rw-r--r--package/source/xstor/owriteablestream.cxx113
-rw-r--r--package/source/xstor/owriteablestream.hxx8
-rw-r--r--package/source/xstor/xfactory.cxx36
-rw-r--r--package/source/xstor/xstorage.cxx171
-rw-r--r--package/source/xstor/xstorage.hxx21
-rw-r--r--package/source/zippackage/ZipPackage.cxx68
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx21
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx7
-rw-r--r--package/util/exports.map8
16 files changed, 267 insertions, 241 deletions
diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx
index e088dceef126..a23a22fcb888 100644
--- a/package/inc/PackageConstants.hxx
+++ b/package/inc/PackageConstants.hxx
@@ -33,10 +33,6 @@ const sal_Int32 n_ConstBufferSize = 32768;
const sal_Int32 n_ConstMaxMemoryStreamSize = 20480;
const sal_Int32 n_ConstDigestLength = 1024;
-#define PACKAGE_FORMAT 1
-#define ZIP_FORMAT 2
-#define OFOPXML_FORMAT 3
-
// the constants related to the manifest.xml entries
#define PKG_MNFST_MEDIATYPE 0
#define PKG_MNFST_VERSION 1
diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index 367bd1d80de5..e3b8d44be183 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -93,7 +93,7 @@ protected:
sal_Bool m_bForceRecovery;
sal_Bool m_bMediaTypeFallbackUsed;
- sal_Int16 m_nFormat;
+ sal_Int32 m_nFormat;
sal_Bool m_bAllowRemoveOnInsert;
InitialisationMode m_eMode;
@@ -125,7 +125,7 @@ public:
virtual ~ZipPackage( void );
ZipFile& getZipFile() { return *m_pZipFile;}
const com::sun::star::uno::Sequence < sal_Int8 > & getEncryptionKey ( ) {return m_aEncryptionKey;}
- sal_Int16 getFormat() const { return m_nFormat; }
+ sal_Int32 getFormat() const { return m_nFormat; }
SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; }
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 85823ba97c2c..89414f18ce65 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -58,13 +58,13 @@ class ZipPackageFolder : public cppu::ImplInheritanceHelper2
protected:
ContentHash maContents;
const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
- sal_Int16 m_nFormat;
+ sal_Int32 m_nFormat;
::rtl::OUString m_sVersion;
public:
ZipPackageFolder( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory,
- sal_Int16 nFormat,
+ sal_Int32 nFormat,
sal_Bool bAllowRemoveOnInsert );
virtual ~ZipPackageFolder();
@@ -87,7 +87,7 @@ public:
return aImplementationId;
}
- void setPackageFormat_Impl( sal_Int16 nFormat ) { m_nFormat = nFormat; }
+ void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; }
// Recursive functions
diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx
index 45bf7c01eb2f..fcb118f4b967 100644
--- a/package/source/xstor/ocompinstream.cxx
+++ b/package/source/xstor/ocompinstream.cxx
@@ -29,6 +29,7 @@
#include "precompiled_package.hxx"
#include "ocompinstream.hxx"
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <osl/diagnose.h>
@@ -41,7 +42,7 @@ using namespace ::com::sun::star;
OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
uno::Reference < io::XInputStream > xStream,
const uno::Sequence< beans::PropertyValue >& aProps,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_pImpl( &aImpl )
, m_rMutexRef( m_pImpl->m_rMutexRef )
, m_xStream( xStream )
@@ -60,7 +61,7 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
//-----------------------------------------------
OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream,
const uno::Sequence< beans::PropertyValue >& aProps,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_pImpl( NULL )
, m_rMutexRef( new SotMutexHolder )
, m_xStream( xStream )
@@ -107,7 +108,7 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType )
if ( aReturn.hasValue() == sal_True )
return aReturn ;
- if ( m_nStorageType == OFOPXML_STORAGE )
+ if ( m_nStorageType == embed::StorageFormats::OFOPXML )
{
aReturn <<= ::cppu::queryInterface
( rType
@@ -356,7 +357,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID )
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
try
@@ -384,7 +385,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID )
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID );
@@ -409,7 +410,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID )
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID );
@@ -434,7 +435,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
// TODO/LATER: in future the unification of the ID could be checked
@@ -464,7 +465,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< uno::Sequence< beans::StringPair > > aResult;
@@ -499,7 +500,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
// TODO/LATER: in future the information could be taken directly from m_pImpl when possible
@@ -530,7 +531,7 @@ void SAL_CALL OInputCompStream::insertRelationshipByID( const ::rtl::OUString&
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
throw io::IOException(); // TODO: Access denied
@@ -550,7 +551,7 @@ void SAL_CALL OInputCompStream::removeRelationshipByID( const ::rtl::OUString&
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
throw io::IOException(); // TODO: Access denied
@@ -570,7 +571,7 @@ void SAL_CALL OInputCompStream::insertRelationships( const uno::Sequence< uno::
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
throw io::IOException(); // TODO: Access denied
@@ -589,7 +590,7 @@ void SAL_CALL OInputCompStream::clearRelationships()
throw lang::DisposedException();
}
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
throw io::IOException(); // TODO: Access denied
diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx
index 047c8dc90758..fcb472e3f92a 100644
--- a/package/source/xstor/ocompinstream.hxx
+++ b/package/source/xstor/ocompinstream.hxx
@@ -60,17 +60,17 @@ protected:
sal_Bool m_bDisposed;
- sal_Int16 m_nStorageType;
+ sal_Int32 m_nStorageType;
public:
OInputCompStream( OWriteStream_Impl& pImpl,
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
OInputCompStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
virtual ~OInputCompStream();
diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx
index 6419889d9d11..0cd3f595c2b3 100644
--- a/package/source/xstor/oseekinstream.cxx
+++ b/package/source/xstor/oseekinstream.cxx
@@ -39,7 +39,7 @@ using namespace ::com::sun::star;
OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
uno::Reference < io::XInputStream > xStream,
const uno::Sequence< beans::PropertyValue >& aProps,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: OInputCompStream( pImpl, xStream, aProps, nStorageType )
{
if ( m_xStream.is() )
@@ -51,7 +51,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > xStream,
const uno::Sequence< beans::PropertyValue >& aProps,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: OInputCompStream( xStream, aProps, nStorageType )
{
if ( m_xStream.is() )
diff --git a/package/source/xstor/oseekinstream.hxx b/package/source/xstor/oseekinstream.hxx
index f8572d717956..92a611af16aa 100644
--- a/package/source/xstor/oseekinstream.hxx
+++ b/package/source/xstor/oseekinstream.hxx
@@ -42,11 +42,11 @@ public:
OInputSeekStream( OWriteStream_Impl& pImpl,
::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
OInputSeekStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
virtual ~OInputSeekStream();
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index c5381a11cfea..2e81c80c4321 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -244,7 +245,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
const uno::Reference< lang::XSingleServiceFactory >& xPackage,
const uno::Reference< lang::XMultiServiceFactory >& xFactory,
sal_Bool bForceEncrypted,
- sal_Int16 nStorageType,
+ sal_Int32 nStorageType,
sal_Bool bDefaultCompress,
const uno::Reference< io::XInputStream >& xRelInfoStream )
: m_pAntiImpl( NULL )
@@ -254,7 +255,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
, m_xFactory( xFactory )
, m_pParent( pParent )
, m_bForceEncrypted( bForceEncrypted )
-, m_bUseCommonPass( !bForceEncrypted && nStorageType == PACKAGE_STORAGE )
+, m_bUseCommonPass( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE )
, m_bHasCachedPassword( sal_False )
, m_bCompressedSetExplicit( !bDefaultCompress )
, m_xPackage( xPackage )
@@ -269,7 +270,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
OSL_ENSURE( xPackage.is(), "No package component is provided!\n" );
OSL_ENSURE( m_xFactory.is(), "No package stream is provided!\n" );
OSL_ENSURE( pParent, "No parent storage is provided!\n" );
- OSL_ENSURE( m_nStorageType == OFOPXML_STORAGE || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" );
+ OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" );
}
//-----------------------------------------------
@@ -359,7 +360,7 @@ void OWriteStream_Impl::InsertIntoPackageFolder( const ::rtl::OUString& aName,
//-----------------------------------------------
sal_Bool OWriteStream_Impl::IsEncrypted()
{
- if ( m_nStorageType != PACKAGE_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
return sal_False;
if ( m_bForceEncrypted || m_bHasCachedPassword )
@@ -419,8 +420,8 @@ sal_Bool OWriteStream_Impl::IsEncrypted()
//-----------------------------------------------
void OWriteStream_Impl::SetDecrypted()
{
- OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE, "The encryption is supported only for package storages!\n" );
- if ( m_nStorageType != PACKAGE_STORAGE )
+ OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" );
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
GetStreamProperties();
@@ -444,8 +445,8 @@ void OWriteStream_Impl::SetDecrypted()
//-----------------------------------------------
void OWriteStream_Impl::SetEncryptedWithPass( const ::rtl::OUString& aPass )
{
- OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE, "The encryption is supported only for package storages!\n" );
- if ( m_nStorageType != PACKAGE_STORAGE )
+ OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" );
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
GetStreamProperties();
@@ -789,12 +790,12 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt
bCompressedIsSet = sal_True;
aProps[nInd].Value >>= bCompressed;
}
- else if ( ( m_nStorageType == OFOPXML_STORAGE || m_nStorageType == PACKAGE_STORAGE )
+ else if ( ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE )
&& aProps[nInd].Name.equals( aMedTypePropName ) )
{
xPropertySet->setPropertyValue( aProps[nInd].Name, aProps[nInd].Value );
}
- else if ( m_nStorageType == PACKAGE_STORAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
+ else if ( m_nStorageType == embed::StorageFormats::PACKAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
aProps[nInd].Value >>= m_bUseCommonPass;
else
throw lang::IllegalArgumentException();
@@ -816,7 +817,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt
if ( m_bUseCommonPass )
{
- if ( m_nStorageType != PACKAGE_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
// set to be encrypted but do not use encryption key
@@ -915,7 +916,7 @@ void OWriteStream_Impl::Commit()
if ( m_bUseCommonPass )
{
- if ( m_nStorageType != PACKAGE_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
// set to be encrypted but do not use encryption key
@@ -926,7 +927,7 @@ void OWriteStream_Impl::Commit()
}
else if ( m_bHasCachedPassword )
{
- if ( m_nStorageType != PACKAGE_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw uno::RuntimeException();
xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ),
@@ -972,7 +973,7 @@ void OWriteStream_Impl::Revert()
m_bHasCachedPassword = sal_False;
m_aPass = ::rtl::OUString();
- 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 >();
@@ -1011,7 +1012,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps(
uno::Sequence< beans::PropertyValue > aResult( aProps );
sal_Int32 nLen = aResult.getLength();
- if ( m_nStorageType == PACKAGE_STORAGE )
+ if ( m_nStorageType == embed::StorageFormats::PACKAGE )
{
for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ )
if ( aResult[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
@@ -1024,7 +1025,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps(
aResult[nLen - 1].Name = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" );
aResult[nLen - 1].Value <<= bUseCommonPass;
}
- else if ( m_nStorageType == OFOPXML_STORAGE )
+ else if ( m_nStorageType == embed::StorageFormats::OFOPXML )
{
ReadRelInfoIfNecessary();
@@ -1061,7 +1062,7 @@ sal_Bool OWriteStream_Impl::IsTransacted()
void OWriteStream_Impl::ReadRelInfoIfNecessary()
{
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
return;
if ( m_nRelInfoStatus == RELINFO_NO_INIT )
@@ -1114,24 +1115,24 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary()
uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProperties()
{
sal_Int32 nPropNum = 0;
- if ( m_nStorageType == ZIP_STORAGE )
+ if ( m_nStorageType == embed::StorageFormats::ZIP )
nPropNum = 2;
- else if ( m_nStorageType == OFOPXML_STORAGE )
+ else if ( m_nStorageType == embed::StorageFormats::OFOPXML )
nPropNum = 3;
- else if ( m_nStorageType == PACKAGE_STORAGE )
+ else if ( m_nStorageType == embed::StorageFormats::PACKAGE )
nPropNum = 4;
uno::Sequence< beans::PropertyValue > aResult( nPropNum );
// The "Compressed" property must be set after "MediaType" property,
// since the setting of the last one can change the value of the first one
- if ( m_nStorageType == OFOPXML_STORAGE || m_nStorageType == PACKAGE_STORAGE )
+ if ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE )
{
aResult[0].Name = ::rtl::OUString::createFromAscii("MediaType");
aResult[1].Name = ::rtl::OUString::createFromAscii("Compressed");
aResult[2].Name = ::rtl::OUString::createFromAscii("Size");
- if ( m_nStorageType == PACKAGE_STORAGE )
+ if ( m_nStorageType == embed::StorageFormats::PACKAGE )
aResult[3].Name = ::rtl::OUString::createFromAscii("Encrypted");
}
else
@@ -1177,7 +1178,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream
OSL_ENSURE( !m_bUseCommonPass, "The stream can not be encrypted!" );
- if ( m_nStorageType != PACKAGE_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE )
throw packages::NoEncryptionException();
if ( m_pAntiImpl )
@@ -1201,7 +1202,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream
//-----------------------------------------------
uno::Sequence< uno::Sequence< beans::StringPair > > OWriteStream_Impl::GetAllRelationshipsIfAny()
{
- if ( m_nStorageType != OFOPXML_STORAGE )
+ if ( m_nStorageType != embed::StorageFormats::OFOPXML )
return uno::Sequence< uno::Sequence< beans::StringPair > >();
ReadRelInfoIfNecessary();
@@ -1516,7 +1517,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream()
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ;
- if ( m_nStorageType != PACKAGE_STORAGE || !m_pParent )
+ if ( m_nStorageType != embed::StorageFormats::PACKAGE || !m_pParent )
throw packages::NoEncryptionException();
return m_pParent->GetCommonRootPass();
@@ -1702,9 +1703,9 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStorage >& xRelStorage, const ::rtl::OUString& aOrigStreamName, const ::rtl::OUString& aNewStreamName )
{
// at this point of time the old stream must be already cleaned
- OSL_ENSURE( m_nStorageType == OFOPXML_STORAGE, "The method should be used only with OFOPXML format!\n" );
+ OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML, "The method should be used only with OFOPXML format!\n" );
- if ( m_nStorageType == OFOPXML_STORAGE )
+ if ( m_nStorageType == embed::StorageFormats::OFOPXML )
{
OSL_ENSURE( aOrigStreamName.getLength() && aNewStreamName.getLength() && xRelStorage.is(),
"Wrong relation persistence information is provided!\n" );
@@ -1972,12 +1973,12 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea
// the order of the properties setting is not important for StorageStream API
::rtl::OUString aPropName = ::rtl::OUString::createFromAscii( "Compressed" );
xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) );
- if ( m_pData->m_nStorageType == PACKAGE_STORAGE || m_pData->m_nStorageType == OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML )
{
aPropName = ::rtl::OUString::createFromAscii( "MediaType" );
xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) );
- if ( m_pData->m_nStorageType == PACKAGE_STORAGE )
+ if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE )
{
aPropName = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" );
xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) );
@@ -2023,13 +2024,13 @@ uno::Any SAL_CALL OWriteStream::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 )
{
aReturn <<= ::cppu::queryInterface
( rType
, static_cast<embed::XEncryptionProtectedSource*> ( this ) );
}
- else if ( m_pData->m_nStorageType == OFOPXML_STORAGE )
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML )
{
aReturn <<= ::cppu::queryInterface
( rType
@@ -2077,7 +2078,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
{
if ( m_bTransacted )
{
- if ( m_pData->m_nStorageType == PACKAGE_STORAGE )
+ if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE )
{
m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
@@ -2093,7 +2094,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
, ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL )
, ::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 )
@@ -2109,7 +2110,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
, ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL )
, ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
}
- else // if ( m_pData->m_nStorageType == ZIP_STORAGE )
+ else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP )
{
m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
@@ -2127,7 +2128,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
}
else
{
- if ( m_pData->m_nStorageType == PACKAGE_STORAGE )
+ if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE )
{
m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
@@ -2140,7 +2141,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
, ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL )
, ::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 )
@@ -2153,7 +2154,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
, ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL )
, ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
}
- else // if ( m_pData->m_nStorageType == ZIP_STORAGE )
+ else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP )
{
m_pData->m_pTypeCollection = new ::cppu::OTypeCollection
( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
@@ -2752,7 +2753,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID )
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
try
@@ -2783,7 +2784,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID )
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID );
@@ -2808,7 +2809,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID )
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID );
@@ -2833,7 +2834,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID(
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
// TODO/LATER: in future the unification of the ID could be checked
@@ -2863,7 +2864,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRe
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< uno::Sequence< beans::StringPair > > aResult;
@@ -2898,7 +2899,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getAl
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
return m_pImpl->GetAllRelationshipsIfAny();
@@ -2918,7 +2919,7 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const ::rtl::OUString& sID,
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) );
@@ -2983,7 +2984,7 @@ void SAL_CALL OWriteStream::removeRelationshipByID( const ::rtl::OUString& sID
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships();
@@ -3025,7 +3026,7 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) );
@@ -3107,7 +3108,7 @@ void SAL_CALL OWriteStream::clearRelationships()
throw lang::DisposedException();
}
- if ( m_pData->m_nStorageType != OFOPXML_STORAGE )
+ if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML )
throw uno::RuntimeException();
m_pImpl->m_aNewRelInfo.realloc( 0 );
@@ -3144,7 +3145,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
m_pImpl->GetStreamProperties();
::rtl::OUString aCompressedString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) );
::rtl::OUString aMediaTypeString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) );
- if ( m_pData->m_nStorageType == PACKAGE_STORAGE && aPropertyName.equals( aMediaTypeString ) )
+ if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equals( aMediaTypeString ) )
{
// if the "Compressed" property is not set explicitly, the MediaType can change the default value
sal_Bool bCompressedValueFromType = sal_True;
@@ -3177,7 +3178,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
m_pImpl->m_aProps[nInd].Value = aValue;
}
}
- else if ( m_pData->m_nStorageType == PACKAGE_STORAGE
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE
&& aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
{
sal_Bool bUseCommonPass = sal_False;
@@ -3202,7 +3203,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
else
throw lang::IllegalArgumentException(); //TODO
}
- else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equals( aMediaTypeString ) )
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equals( aMediaTypeString ) )
{
for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ )
{
@@ -3210,7 +3211,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
m_pImpl->m_aProps[nInd].Value = aValue;
}
}
- else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equalsAscii( "RelationsInfoStream" ) )
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfoStream" ) )
{
uno::Reference< io::XInputStream > xInRelStream;
if ( ( aValue >>= xInRelStream ) && xInRelStream.is() )
@@ -3231,7 +3232,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
else
throw lang::IllegalArgumentException(); // TODO
}
- else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equalsAscii( "RelationsInfo" ) )
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfo" ) )
{
if ( aValue >>= m_pImpl->m_aNewRelInfo )
{
@@ -3241,7 +3242,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa
}
else if ( aPropertyName.equalsAscii( "Size" ) )
throw beans::PropertyVetoException(); // TODO
- else if ( m_pData->m_nStorageType == PACKAGE_STORAGE
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE
&& ( aPropertyName.equalsAscii( "IsEncrypted" ) || aPropertyName.equalsAscii( "Encrypted" ) ) )
throw beans::PropertyVetoException(); // TODO
else
@@ -3277,9 +3278,9 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp )
else
aPropertyName = aProp;
- if ( ( ( m_pData->m_nStorageType == PACKAGE_STORAGE || m_pData->m_nStorageType == OFOPXML_STORAGE )
+ if ( ( ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML )
&& aPropertyName.equalsAscii( "MediaType" ) )
- || m_pData->m_nStorageType == PACKAGE_STORAGE && aPropertyName.equalsAscii( "Encrypted" )
+ || m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "Encrypted" )
|| aPropertyName.equalsAscii( "Compressed" ) )
{
m_pImpl->GetStreamProperties();
@@ -3290,7 +3291,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp )
return m_pImpl->m_aProps[nInd].Value;
}
}
- else if ( m_pData->m_nStorageType == PACKAGE_STORAGE
+ else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE
&& aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) )
return uno::makeAny( m_pImpl->m_bUseCommonPass );
else if ( aPropertyName.equalsAscii( "Size" ) )
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index 94b97fb09eb2..0d4a29893887 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -83,10 +83,10 @@ struct WSInternalData_Impl
SotMutexHolderRef m_rSharedMutexRef;
::cppu::OTypeCollection* m_pTypeCollection;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners
- sal_Int16 m_nStorageType;
+ sal_Int32 m_nStorageType;
// the mutex reference MUST NOT be empty
- WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int16 nStorageType )
+ WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int32 nStorageType )
: m_rSharedMutexRef( rMutexRef )
, m_pTypeCollection( NULL )
, m_aListenersContainer( rMutexRef->GetMutex() )
@@ -137,7 +137,7 @@ struct OWriteStream_Impl : public PreCreationStruct
sal_Bool m_bHasInsertedStreamOptimization;
- sal_Int16 m_nStorageType;
+ sal_Int32 m_nStorageType;
// Relations info related data, stored in *.rels file in OFOPXML format
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOrigRelInfoStream;
@@ -175,7 +175,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >& xPackage,
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
sal_Bool bForceEncrypted,
- sal_Int16 nStorageType,
+ sal_Int32 nStorageType,
sal_Bool bDefaultCompress,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xRelInfoStream =
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >() );
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index e78742641a0b..68c393fed08b 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -29,9 +29,11 @@
#include "precompiled_package.hxx"
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/io/XSeekable.hpp>
+#include <comphelper/storagehelper.hxx>
#include "xfactory.hxx"
#include "xstorage.hxx"
@@ -101,7 +103,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance()
embed::ElementModes::READWRITE,
uno::Sequence< beans::PropertyValue >(),
m_xFactory,
- PACKAGE_STORAGE ) ),
+ embed::StorageFormats::PACKAGE ) ),
uno::UNO_QUERY );
}
@@ -184,7 +186,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
uno::Sequence< beans::PropertyValue > aDescr;
uno::Sequence< beans::PropertyValue > aPropsToSet;
- sal_Int16 nStorageType = PACKAGE_STORAGE;
+ sal_Int32 nStorageType = embed::StorageFormats::PACKAGE;
if ( nArgNum >= 3 )
{
@@ -212,15 +214,29 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
else if ( aDescr[nInd].Name.equalsAscii( "StorageFormat" ) )
{
::rtl::OUString aFormatName;
- aDescr[nInd].Value >>= aFormatName;
- if ( aFormatName.equalsAscii( "PackageFormat" ) )
- nStorageType = PACKAGE_STORAGE;
- else if ( aFormatName.equalsAscii( "ZipFormat" ) )
- nStorageType = ZIP_STORAGE;
- else if ( aFormatName.equalsAscii( "OFOPXMLFormat" ) )
- nStorageType = OFOPXML_STORAGE;
+ sal_Int32 nFormatID = 0;
+ if ( aDescr[nInd].Value >>= aFormatName )
+ {
+ if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) )
+ nStorageType = embed::StorageFormats::PACKAGE;
+ else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) )
+ nStorageType = embed::StorageFormats::ZIP;
+ else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) )
+ nStorageType = embed::StorageFormats::OFOPXML;
+ else
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
+ }
+ else if ( aDescr[nInd].Value >>= nFormatID )
+ {
+ if ( nFormatID != embed::StorageFormats::PACKAGE
+ && nFormatID != embed::StorageFormats::ZIP
+ && nFormatID != embed::StorageFormats::OFOPXML )
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
+
+ nStorageType = nFormatID;
+ }
else
- throw lang::IllegalArgumentException(); // TODO:
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
}
else
OSL_ENSURE( sal_False, "Unacceptable property, will be ignored!\n" );
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 55ff5a87e78d..007f199332c5 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>
@@ -72,7 +73,7 @@ struct StorInternalData_Impl
::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners
::cppu::OTypeCollection* m_pTypeCollection;
sal_Bool m_bIsRoot;
- sal_Int16 m_nStorageType; // the mode in wich the storage is used
+ sal_Int32 m_nStorageType; // the mode in wich the storage is used
sal_Bool m_bReadOnlyWrap;
OChildDispListener_Impl* m_pSubElDispListener;
@@ -82,12 +83,12 @@ struct StorInternalData_Impl
::rtl::Reference< OHierarchyHolder_Impl > m_rHierarchyHolder;
// the mutex reference MUST NOT be empty
- StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int16 nStorType, sal_Bool bReadOnlyWrap )
+ StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int32 nStorageType, sal_Bool bReadOnlyWrap )
: m_rSharedMutexRef( rMutexRef )
, m_aListenersContainer( rMutexRef->GetMutex() )
, m_pTypeCollection( NULL )
, m_bIsRoot( bRoot )
- , m_nStorageType( nStorType )
+ , m_nStorageType( nStorageType )
, m_bReadOnlyWrap( bReadOnlyWrap )
, m_pSubElDispListener( NULL )
{}
@@ -102,7 +103,7 @@ struct StorInternalData_Impl
void OStorage_Impl::completeStorageStreamCopy_Impl(
const uno::Reference< io::XStream >& xSource,
const uno::Reference< io::XStream >& xDest,
- sal_Int16 nStorageType,
+ sal_Int32 nStorageType,
const uno::Sequence< uno::Sequence< beans::StringPair > >& aRelInfo )
{
uno::Reference< beans::XPropertySet > xSourceProps( xSource, uno::UNO_QUERY );
@@ -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 );
@@ -195,7 +196,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream,
sal_Int32 nMode,
uno::Sequence< beans::PropertyValue > xProperties,
uno::Reference< lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_rMutexRef( new SotMutexHolder )
, m_pAntiImpl( NULL )
, m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE )
@@ -235,7 +236,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream,
sal_Int32 nMode,
uno::Sequence< beans::PropertyValue > xProperties,
uno::Reference< lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_rMutexRef( new SotMutexHolder )
, m_pAntiImpl( NULL )
, m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE )
@@ -278,7 +279,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent,
uno::Reference< container::XNameContainer > xPackageFolder,
uno::Reference< lang::XSingleServiceFactory > xPackage,
uno::Reference< lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_rMutexRef( new SotMutexHolder )
, m_pAntiImpl( NULL )
, m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE )
@@ -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 >() );
@@ -1923,7 +1924,7 @@ OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream,
sal_Int32 nMode,
uno::Sequence< beans::PropertyValue > xProperties,
uno::Reference< lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xFactory, nStorageType ) )
{
m_pImpl->m_pAntiImpl = this;
@@ -1935,7 +1936,7 @@ OStorage::OStorage( uno::Reference< io::XStream > xStream,
sal_Int32 nMode,
uno::Sequence< beans::PropertyValue > xProperties,
uno::Reference< lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType )
+ sal_Int32 nStorageType )
: m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xFactory, nStorageType ) )
{
m_pImpl->m_pAntiImpl = this;
@@ -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 ) )
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index bc90b71e4d93..f1c50e4d67bd 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -57,11 +57,6 @@
#include "mutexholder.hxx"
-
-#define PACKAGE_STORAGE 0
-#define ZIP_STORAGE 1
-#define OFOPXML_STORAGE 2
-
#define RELINFO_NO_INIT 1
#define RELINFO_READ 2
#define RELINFO_CHANGED 3
@@ -177,9 +172,9 @@ struct OStorage_Impl
SwitchablePersistenceStream* m_pSwitchStream;
- sal_Int16 m_nStorageType; // the mode in wich the storage is used
+ sal_Int32 m_nStorageType; // the mode in wich the storage is used
- // the _rels substorage that is handled in a special way in OFOPXML_STORAGE
+ // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML
SotElement_Impl* m_pRelStorElement;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo;
@@ -193,13 +188,13 @@ struct OStorage_Impl
sal_Int32 nMode,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
sal_Int32 nMode,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
// constructor for a substorage
OStorage_Impl( OStorage_Impl* pParent,
@@ -207,7 +202,7 @@ struct OStorage_Impl
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
~OStorage_Impl();
@@ -287,7 +282,7 @@ struct OStorage_Impl
static void completeStorageStreamCopy_Impl(
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest,
- sal_Int16 nStorageType,
+ sal_Int32 nStorageType,
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo );
};
@@ -330,13 +325,13 @@ public:
sal_Int32 nMode,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream,
sal_Int32 nMode,
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
- sal_Int16 nStorageType );
+ sal_Int32 nStorageType );
OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap );
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 5c22bad46a6a..9ba26e0100c5 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/io/XActiveDataStreamer.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/UseBackupException.hpp>
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <cppuhelper/implbase1.hxx>
#include <ContentInfo.hxx>
@@ -183,7 +184,7 @@ ZipPackage::ZipPackage (const uno::Reference < XMultiServiceFactory > &xNewFacto
, m_bUseManifest ( sal_True )
, m_bForceRecovery ( sal_False )
, m_bMediaTypeFallbackUsed ( sal_False )
-, m_nFormat( PACKAGE_FORMAT ) // package is the default format
+, m_nFormat( embed::StorageFormats::PACKAGE ) // package is the default format
, m_bAllowRemoveOnInsert( sal_True )
, m_eMode ( e_IMode_None )
, m_xFactory( xNewFactory )
@@ -217,7 +218,7 @@ ZipPackage::~ZipPackage( void )
void ZipPackage::parseManifest()
{
- if ( m_nFormat == PACKAGE_FORMAT )
+ if ( m_nFormat == embed::StorageFormats::PACKAGE )
{
sal_Bool bManifestParsed = sal_False;
const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) );
@@ -427,7 +428,7 @@ void ZipPackage::parseManifest()
void ZipPackage::parseContentType()
{
- if ( m_nFormat == OFOPXML_FORMAT )
+ if ( m_nFormat == embed::StorageFormats::OFOPXML )
{
const ::rtl::OUString aContentTypes( RTL_CONSTASCII_USTRINGPARAM ( "[Content_Types].xml" ) );
try {
@@ -507,7 +508,14 @@ void ZipPackage::getZipFileContents()
nIndex = nOldIndex = 0;
pCurrent = m_pRootFolder;
const ZipEntry & rEntry = *pEnum->nextElement();
- const OUString & rName = rEntry.sPath;
+ OUString rName = rEntry.sPath;
+
+ if ( m_bForceRecovery )
+ {
+ // the PKZIP Application note version 6.2 does not allows to use '\' as separator
+ // unfortunately it is used by some implementations, so we have to support it in recovery mode
+ rName = rName.replace( '\\', '/' );
+ }
nStreamIndex = rName.lastIndexOf ( '/' );
if ( nStreamIndex != -1 )
@@ -551,9 +559,9 @@ void ZipPackage::getZipFileContents()
}
}
- if ( m_nFormat == PACKAGE_FORMAT )
+ if ( m_nFormat == embed::StorageFormats::PACKAGE )
parseManifest();
- else if ( m_nFormat == OFOPXML_FORMAT )
+ else if ( m_nFormat == embed::StorageFormats::OFOPXML )
parseContentType();
}
@@ -593,13 +601,13 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments )
}
else if ( aCommand.equals( OUString::createFromAscii( "purezip" ) ) )
{
- m_nFormat = ZIP_FORMAT;
+ m_nFormat = embed::StorageFormats::ZIP;
m_pRootFolder->setPackageFormat_Impl( m_nFormat );
break;
}
else if ( aCommand.equals( OUString::createFromAscii( "ofopxml" ) ) )
{
- m_nFormat = OFOPXML_FORMAT;
+ m_nFormat = embed::StorageFormats::OFOPXML;
m_pRootFolder->setPackageFormat_Impl( m_nFormat );
break;
}
@@ -654,20 +662,34 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments )
sal_Bool bPackFormat = sal_True;
aNamedValue.Value >>= bPackFormat;
if ( !bPackFormat )
- m_nFormat = ZIP_FORMAT;
+ m_nFormat = embed::StorageFormats::ZIP;
m_pRootFolder->setPackageFormat_Impl( m_nFormat );
}
else if ( aNamedValue.Name.equalsAscii( "StorageFormat" ) )
{
::rtl::OUString aFormatName;
- aNamedValue.Value >>= aFormatName;
- if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) )
- m_nFormat = PACKAGE_FORMAT;
- else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) )
- m_nFormat = ZIP_FORMAT;
- else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) )
- m_nFormat = OFOPXML_FORMAT;
+ sal_Int32 nFormatID = 0;
+ if ( aNamedValue.Value >>= aFormatName )
+ {
+ if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) )
+ m_nFormat = embed::StorageFormats::PACKAGE;
+ else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) )
+ m_nFormat = embed::StorageFormats::ZIP;
+ else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) )
+ m_nFormat = embed::StorageFormats::OFOPXML;
+ else
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
+ }
+ else if ( aNamedValue.Value >>= nFormatID )
+ {
+ if ( nFormatID != embed::StorageFormats::PACKAGE
+ && nFormatID != embed::StorageFormats::ZIP
+ && nFormatID != embed::StorageFormats::OFOPXML )
+ throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
+
+ m_nFormat = nFormatID;
+ }
else
throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 );
@@ -1135,7 +1157,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
try
{
- if ( m_nFormat == PACKAGE_FORMAT )
+ if ( m_nFormat == embed::StorageFormats::PACKAGE )
{
// Remove the old manifest.xml file as the
// manifest will be re-generated and the
@@ -1157,7 +1179,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
// Write a magic file with mimetype
WriteMimetypeMagicFile( aZipOut );
}
- else if ( m_nFormat == OFOPXML_FORMAT )
+ else if ( m_nFormat == embed::StorageFormats::OFOPXML )
{
// Remove the old [Content_Types].xml file as the
// file will be re-generated
@@ -1175,7 +1197,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
const OUString sVersion ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) );
const OUString sFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) );
- if ( m_nFormat == PACKAGE_FORMAT )
+ if ( m_nFormat == embed::StorageFormats::PACKAGE )
{
Sequence < PropertyValue > aPropSeq ( PKG_SIZE_NOENCR_MNFST );
aPropSeq [PKG_MNFST_MEDIATYPE].Name = sMediaType;
@@ -1204,11 +1226,11 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
// Clean up random pool memory
rtl_random_destroyPool ( aRandomPool );
- if( m_bUseManifest && m_nFormat == PACKAGE_FORMAT )
+ if( m_bUseManifest && m_nFormat == embed::StorageFormats::PACKAGE )
{
WriteManifest( aZipOut, aManList );
}
- else if( m_nFormat == OFOPXML_FORMAT )
+ else if( m_nFormat == embed::StorageFormats::OFOPXML )
{
WriteContentTypes( aZipOut, aManList );
}
@@ -1618,7 +1640,7 @@ uno::Reference< XPropertySetInfo > SAL_CALL ZipPackage::getPropertySetInfo( )
void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const Any& aValue )
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- if ( m_nFormat != PACKAGE_FORMAT )
+ if ( m_nFormat != embed::StorageFormats::PACKAGE )
throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasEncryptedEntries") )
@@ -1643,7 +1665,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
// TODO/LATER: Activate the check when zip-ucp is ready
- // if ( m_nFormat != PACKAGE_FORMAT )
+ // if ( m_nFormat != embed::StorageFormats::PACKAGE )
// throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
Any aAny;
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 1d14738d2b5f..f0c4a11d22f4 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -34,6 +34,7 @@
#include <PackageConstants.hxx>
#include <ZipPackageFolderEnumeration.hxx>
#include <com/sun/star/packages/zip/ZipConstants.hpp>
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <vos/diagnose.hxx>
#include <osl/time.h>
#include <rtl/digest.h>
@@ -61,7 +62,7 @@ using vos::ORef;
Sequence < sal_Int8 > ZipPackageFolder::aImplementationId = Sequence < sal_Int8 > ();
ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory,
- sal_Int16 nFormat,
+ sal_Int32 nFormat,
sal_Bool bAllowRemoveOnInsert )
: m_xFactory( xFactory )
, m_nFormat( nFormat )
@@ -317,7 +318,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
sal_Bool bHaveEncryptionKey = rEncryptionKey.getLength() ? sal_True : sal_False;
- if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != OFOPXML_FORMAT )
+ if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != embed::StorageFormats::OFOPXML )
{
// it is an empty subfolder, use workaround to store it
ZipEntry* pTempEntry = new ZipEntry();
@@ -539,11 +540,11 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
// If the entry is already stored in the zip file in the format we
// want for this write...copy it raw
- if ( !bUseNonSeekableAccess &&
- ( bRawStream || bTransportOwnEncrStreamAsRaw ||
- ( pStream->IsPackageMember() && !bToBeEncrypted &&
- ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) ||
- ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) )
+ if ( !bUseNonSeekableAccess
+ && ( bRawStream || bTransportOwnEncrStreamAsRaw
+ || ( pStream->IsPackageMember() && !bToBeEncrypted
+ && ( ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed )
+ || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) )
{
// If it's a PackageMember, then it's an unbuffered stream and we need
// to get a new version of it as we can't seek backwards.
@@ -689,7 +690,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
}
// folder can have a mediatype only in package format
- if ( m_nFormat == PACKAGE_FORMAT || ( m_nFormat == OFOPXML_FORMAT && !rInfo.bFolder ) )
+ if ( m_nFormat == embed::StorageFormats::PACKAGE || ( m_nFormat == embed::StorageFormats::OFOPXML && !rInfo.bFolder ) )
rManList.push_back( aPropSet );
}
@@ -741,7 +742,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName,
if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")))
{
// TODO/LATER: activate when zip ucp is ready
- // if ( m_nFormat != PACKAGE_FORMAT )
+ // if ( m_nFormat != embed::StorageFormats::PACKAGE )
// throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
aValue >>= sMediaType;
@@ -759,7 +760,7 @@ Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName )
if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) )
{
// TODO/LATER: activate when zip ucp is ready
- // if ( m_nFormat != PACKAGE_FORMAT )
+ // if ( m_nFormat != embed::StorageFormats::PACKAGE )
// throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
return makeAny ( sMediaType );
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index b6893b5cb2ad..6343607c8711 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_package.hxx"
#include <com/sun/star/packages/zip/ZipConstants.hpp>
+#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
@@ -611,7 +612,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
{
if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")))
{
- if ( rZipPackage.getFormat() != PACKAGE_FORMAT && rZipPackage.getFormat() != OFOPXML_FORMAT )
+ if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE && rZipPackage.getFormat() != embed::StorageFormats::OFOPXML )
throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
if ( aValue >>= sMediaType )
@@ -640,7 +641,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
}
else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Encrypted") ) )
{
- if ( rZipPackage.getFormat() != PACKAGE_FORMAT )
+ if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE )
throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
sal_Bool bEnc = sal_False;
@@ -664,7 +665,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
}
else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EncryptionKey") ) )
{
- if ( rZipPackage.getFormat() != PACKAGE_FORMAT )
+ if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE )
throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
Sequence < sal_Int8 > aNewKey;
diff --git a/package/util/exports.map b/package/util/exports.map
deleted file mode 100644
index 7e12f34d1b86..000000000000
--- a/package/util/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-PKG_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};