diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-09-28 11:45:33 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-09-28 11:45:33 -0400 |
commit | 6debc8710fdd6d534a63ec40e205bee87a8b084a (patch) | |
tree | 1cf2d6cf819e6e70c7f25bdfd1753070fcfbb463 /sc/inc/tabprotection.hxx | |
parent | Forgot to add new files created by cws-koheicopyborder-sc.diff. (diff) | |
download | core-6debc8710fdd6d534a63ec40e205bee87a8b084a.tar.gz core-6debc8710fdd6d534a63ec40e205bee87a8b084a.zip |
Ported calc-ods-sheet-protection-sc.diff from ooo-build.
Diffstat (limited to 'sc/inc/tabprotection.hxx')
-rw-r--r-- | sc/inc/tabprotection.hxx | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx index 128102500b4a..537a245d827b 100644 --- a/sc/inc/tabprotection.hxx +++ b/sc/inc/tabprotection.hxx @@ -32,7 +32,6 @@ #include <com/sun/star/uno/Sequence.hxx> #include "global.hxx" -#include <vector> #include <boost/shared_ptr.hpp> #define ENABLE_SHEET_PROTECTION 1 @@ -42,8 +41,9 @@ class ScTableProtectionImpl; enum ScPasswordHash { - PASSHASH_OOO = 0, - PASSHASH_XL + PASSHASH_SHA1 = 0, + PASSHASH_XL, + PASSHASH_UNSPECIFIED }; class ScPassHashHelper @@ -53,7 +53,11 @@ public: least one hash that needs to be regenerated, it returns true. If all hash values are compatible with the specified hash type, then it returns false. */ - static bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash); + static bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); + + static ::rtl::OUString getHashURI(ScPasswordHash eHash); + + static ScPasswordHash getHashTypeFromURI(const ::rtl::OUString& rURI); private: ScPassHashHelper(); @@ -72,11 +76,13 @@ public: virtual void setProtected(bool bProtected) = 0; virtual bool isPasswordEmpty() const = 0; - virtual bool hasPasswordHash(ScPasswordHash eHash) const = 0; + virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const = 0; virtual void setPassword(const String& aPassText) = 0; - virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const = 0; - virtual void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, - ScPasswordHash eHash = PASSHASH_OOO) = 0; + virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash( + ScPasswordHash eHash, ScPasswordHash eHas2 = PASSHASH_UNSPECIFIED) const = 0; + virtual void setPasswordHash( + const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, + ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) = 0; virtual bool verifyPassword(const String& aPassText) const = 0; }; @@ -102,11 +108,13 @@ public: virtual void setProtected(bool bProtected); virtual bool isPasswordEmpty() const; - virtual bool hasPasswordHash(ScPasswordHash eHash) const; + virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; virtual void setPassword(const String& aPassText); - virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const; - virtual void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, - ScPasswordHash eHash = PASSHASH_OOO); + virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash( + ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; + virtual void setPasswordHash( + const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, + ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); virtual bool verifyPassword(const String& aPassText) const; bool isOptionEnabled(Option eOption) const; @@ -159,11 +167,13 @@ public: virtual void setProtected(bool bProtected); virtual bool isPasswordEmpty() const; - virtual bool hasPasswordHash(ScPasswordHash eHash) const; + virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; virtual void setPassword(const String& aPassText); - virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash(ScPasswordHash eHash) const; - virtual void setPasswordHash(const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, - ScPasswordHash eHash = PASSHASH_OOO); + virtual ::com::sun::star::uno::Sequence<sal_Int8> getPasswordHash( + ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; + virtual void setPasswordHash( + const ::com::sun::star::uno::Sequence<sal_Int8>& aPassword, + ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); virtual bool verifyPassword(const String& aPassText) const; bool isOptionEnabled(Option eOption) const; |