diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-10-13 09:54:28 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-10-23 14:30:30 +0200 |
commit | 1b3122a1895e6eff7341fda39a5f68d7a60c7aa0 (patch) | |
tree | ba255b57efda771d9ce2376ad375836c39427e0c /package/inc | |
parent | 152c4afef44d6e6456777a7cd0de4e3a3a2a9338 (diff) |
package: Add pure virtual ZipPackageEntry::saveChild()
..and adapt what needs to be changed.
So that, we can kill at least some usages of horrible ContentInfo struct.
Change-Id: I32d41f3b8ce2dfb65f0d1df18a540a3f67dcab6d
Diffstat (limited to 'package/inc')
-rw-r--r-- | package/inc/ZipPackageEntry.hxx | 17 | ||||
-rw-r--r-- | package/inc/ZipPackageFolder.hxx | 24 | ||||
-rw-r--r-- | package/inc/ZipPackageStream.hxx | 13 |
3 files changed, 33 insertions, 21 deletions
diff --git a/package/inc/ZipPackageEntry.hxx b/package/inc/ZipPackageEntry.hxx index cfe1895f2804..d1ff8de8b5cf 100644 --- a/package/inc/ZipPackageEntry.hxx +++ b/package/inc/ZipPackageEntry.hxx @@ -21,13 +21,19 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <ZipEntry.hxx> #include <cppuhelper/implbase5.hxx> +#include <vector> + +typedef void* rtlRandomPool; +class ZipOutputStream; class ZipPackageFolder; class ZipPackageEntry : public cppu::WeakImplHelper5 @@ -40,15 +46,18 @@ class ZipPackageEntry : public cppu::WeakImplHelper5 > { protected: + css::uno::Reference< css::uno::XComponentContext > m_xContext; OUString msName; bool mbIsFolder:1; bool mbAllowRemoveOnInsert:1; // com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > xParent; OUString msMediaType; ZipPackageFolder* mpParent; + sal_Int32 m_nFormat; + public: ZipEntry aEntry; - ZipPackageEntry ( bool bNewFolder = false ); + ZipPackageEntry(); virtual ~ZipPackageEntry( void ); const OUString& GetMediaType () const { return msMediaType; } @@ -58,6 +67,12 @@ public: const ZipPackageFolder* GetParent () const { return mpParent; } void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; } + virtual bool saveChild( const OUString &rPath, + std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList, + ZipOutputStream & rZipOut, + const css::uno::Sequence < sal_Int8 >& rEncryptionKey, + const rtlRandomPool &rRandomPool ) = 0; + void clearParent ( void ) { // xParent.clear(); diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx index dd0ff95ba8ad..52a64e6dee02 100644 --- a/package/inc/ZipPackageFolder.hxx +++ b/package/inc/ZipPackageFolder.hxx @@ -28,20 +28,8 @@ #include <cppuhelper/implbase2.hxx> #include <vector> -namespace com { namespace sun { namespace star { -namespace beans -{ - struct PropertyValue; -} -namespace packages -{ - class ContentInfo; -} -} } } - class ZipOutputStream; struct ZipEntry; -typedef void* rtlRandomPool; class ZipPackageFolder : public cppu::ImplInheritanceHelper2 < @@ -51,14 +39,12 @@ class ZipPackageFolder : public cppu::ImplInheritanceHelper2 > { private: - css::uno::Reference< css::uno::XComponentContext> m_xContext; ContentHash maContents; - sal_Int32 m_nFormat; OUString m_sVersion; public: - ZipPackageFolder( css::uno::Reference< css::uno::XComponentContext> xContext, + ZipPackageFolder( const css::uno::Reference < css::uno::XComponentContext >& xContext, sal_Int32 nFormat, bool bAllowRemoveOnInsert ); virtual ~ZipPackageFolder(); @@ -80,7 +66,13 @@ public: static ::com::sun::star::uno::Sequence < sal_Int8 > static_getImplementationId(); void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; } - void setRemoveOnInsertMode_Impl( bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; } + void setRemoveOnInsertMode_Impl( bool bRemove ) { mbAllowRemoveOnInsert = bRemove; } + + virtual bool saveChild( const OUString &rPath, + std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList, + ZipOutputStream & rZipOut, + const css::uno::Sequence < sal_Int8 >& rEncryptionKey, + const rtlRandomPool &rRandomPool ) SAL_OVERRIDE; // Recursive functions void saveContents( diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx index d7c19f1636f8..758dbb8e4d70 100644 --- a/package/inc/ZipPackageStream.hxx +++ b/package/inc/ZipPackageStream.hxx @@ -48,7 +48,6 @@ class ZipPackageStream : public cppu::ImplInheritanceHelper2 { private: com::sun::star::uno::Reference < com::sun::star::io::XInputStream > m_xStream; - const ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_xContext; ZipPackage &m_rZipPackage; bool m_bToBeCompressed, m_bToBeEncrypted, m_bHaveOwnKey, m_bIsEncrypted; @@ -140,9 +139,10 @@ public: void CloseOwnStreamIfAny(); - ZipPackageStream ( ZipPackage & rNewPackage, - const ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& xContext, - bool bAllowRemoveOnInsert ); + ZipPackageStream( ZipPackage & rNewPackage, + const css::uno::Reference < css::uno::XComponentContext >& xContext, + sal_Int32 nFormat, + bool bAllowRemoveOnInsert ); virtual ~ZipPackageStream( void ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetRawEncrStreamNoHeaderCopy(); @@ -150,6 +150,11 @@ public: bool bAddHeaderForEncr ); bool ParsePackageRawStream(); + virtual bool saveChild( const OUString &rPath, + std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList, + ZipOutputStream & rZipOut, + const css::uno::Sequence < sal_Int8 >& rEncryptionKey, + const rtlRandomPool &rRandomPool ) SAL_OVERRIDE; void setZipEntryOnLoading( const ZipEntry &rInEntry); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData() |