diff options
Diffstat (limited to 'package/inc')
-rw-r--r-- | package/inc/ZipFile.hxx | 14 | ||||
-rw-r--r-- | package/inc/ZipPackage.hxx | 17 | ||||
-rw-r--r-- | package/inc/ZipPackageBuffer.hxx | 2 | ||||
-rw-r--r-- | package/inc/zipfileaccess.hxx | 6 |
4 files changed, 30 insertions, 9 deletions
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 287b899f7ab0..aaabda3181f0 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -40,6 +40,7 @@ #include <Inflater.hxx> #endif +#include <mutexholder.hxx> namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } @@ -90,6 +91,7 @@ protected: // aMediaType parameter is used only for raw stream header creation com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createUnbufferedStream( + SotMutexHolderRef aMutexHolder, ZipEntry & rEntry, const vos::ORef < EncryptionData > &rData, sal_Int8 nStreamMode, @@ -128,7 +130,8 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData( ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData, - sal_Bool bDecrypt) + sal_Bool bDecrypt, + SotMutexHolderRef aMutexHolder ) throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); static sal_Bool StaticGetCipher ( const vos::ORef < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode ); @@ -157,13 +160,15 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData, - sal_Bool bDecrypt ) + sal_Bool bDecrypt, + SotMutexHolderRef aMutexHolder ) throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getDataStream( ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData, - sal_Bool bDecrypt ) + sal_Bool bDecrypt, + SotMutexHolderRef aMutexHolder ) throw ( ::com::sun::star::packages::WrongPasswordException, ::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, @@ -172,7 +177,8 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getWrappedRawStream( ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData, - const ::rtl::OUString& aMediaType ) + const ::rtl::OUString& aMediaType, + SotMutexHolderRef aMutexHolder ) throw ( ::com::sun::star::packages::NoEncryptionException, ::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 93d7b83c95ff..b733171edc4b 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -37,12 +37,15 @@ #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> #ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> #endif #include <HashMaps.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <osl/file.h> +#include <mutexholder.hxx> + class ZipOutputStream; class ZipPackageFolder; class ZipFile; @@ -81,6 +84,8 @@ class ZipPackage : public cppu::WeakImplHelper7 > { protected: + SotMutexHolderRef m_aMutexHolder; + ::com::sun::star::uno::Sequence < sal_Int8 > aEncryptionKey; FolderHash aRecent; ::rtl::OUString sURL; @@ -106,9 +111,13 @@ protected: void parseManifest(); void parseContentType(); void getZipFileContents(); - sal_Bool writeFileIsTemp(); - ::com::sun::star::uno::Reference < ::com::sun::star::io::XActiveDataStreamer > openOriginalForOutput(); + void WriteMimetypeMagicFile( ZipOutputStream& aZipOut ); + void WriteManifest( ZipOutputStream& aZipOut, const ::std::vector< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& aManList ); + void WriteContentTypes( ZipOutputStream& aZipOut, const ::std::vector< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& aManList ); + + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > writeTempFile(); + ::com::sun::star::uno::Reference < ::com::sun::star::io::XActiveDataStreamer > openOriginalForOutput(); void DisconnectFromTargetAndThrowException_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xTempStream ); @@ -119,6 +128,10 @@ public: const com::sun::star::uno::Sequence < sal_Int8 > & getEncryptionKey ( ) {return aEncryptionKey;} sal_Int16 getFormat() const { return m_nFormat; } + SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; } + + void ConnectTo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream ); + // XInitialization virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); diff --git a/package/inc/ZipPackageBuffer.hxx b/package/inc/ZipPackageBuffer.hxx index 222422fe6409..81f461bb2e77 100644 --- a/package/inc/ZipPackageBuffer.hxx +++ b/package/inc/ZipPackageBuffer.hxx @@ -56,7 +56,7 @@ public: inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); } inline const sal_Int8 * getConstArray () const { return m_aBuffer.getConstArray(); } - inline const com::sun::star::uno::Sequence < sal_Int8> & getSequence () const { return m_aBuffer; } + inline const com::sun::star::uno::Sequence < sal_Int8> getSequence () const { return m_aBuffer; } // XInputStream virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index 434ddefb61c2..fbee9799930e 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -40,7 +40,8 @@ #include <cppuhelper/interfacecontainer.h> #include <cppuhelper/implbase5.hxx> -#include <osl/mutex.hxx> + +#include <mutexholder.hxx> #include <ZipFile.hxx> #include <HashMaps.hxx> @@ -52,7 +53,8 @@ class OZipFileAccess : public ::cppu::WeakImplHelper5< ::com::sun::star::lang::XComponent, ::com::sun::star::lang::XServiceInfo > { - ::osl::Mutex m_aMutex; + SotMutexHolderRef m_aMutexHolder; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xContentStream; |