summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-24 15:06:28 +0100
committerEike Rathke <erack@redhat.com>2018-02-24 21:02:41 +0100
commit0423db153603368a69297e5309d3065d57c4d068 (patch)
tree00601ce1249180f59fe2aa0262381fe96da798d3
parentc6eb3bf58c9c236dc7fe47fb9c4df7dd2a98c2d0 (diff)
Add ScTableProtectionImpl::setPasswordHash() for OOXML, tdf#104250 prep
Change-Id: I9589f750cf2f69f4b725cd351aa9ef3749190431
-rw-r--r--sc/inc/tabprotection.hxx6
-rw-r--r--sc/source/core/data/tabprotection.cxx23
2 files changed, 29 insertions, 0 deletions
diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx
index f33981699b9b..4c9edcb2f4cc 100644
--- a/sc/inc/tabprotection.hxx
+++ b/sc/inc/tabprotection.hxx
@@ -88,6 +88,8 @@ public:
virtual void setPasswordHash(
const css::uno::Sequence<sal_Int8>& aPassword,
ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) = 0;
+ virtual void setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount ) = 0;
virtual bool verifyPassword(const OUString& aPassText) const = 0;
};
@@ -117,6 +119,8 @@ public:
virtual void setPasswordHash(
const css::uno::Sequence<sal_Int8>& aPassword,
ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) override;
+ virtual void setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount ) override;
virtual bool verifyPassword(const OUString& aPassText) const override;
bool isOptionEnabled(Option eOption) const;
@@ -198,6 +202,8 @@ public:
virtual void setPasswordHash(
const css::uno::Sequence<sal_Int8>& aPassword,
ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) override;
+ virtual void setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount ) override;
virtual bool verifyPassword(const OUString& aPassText) const override;
bool isOptionEnabled(Option eOption) const;
diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx
index b0732aa23dc0..5379e2beba45 100644
--- a/sc/source/core/data/tabprotection.cxx
+++ b/sc/source/core/data/tabprotection.cxx
@@ -127,6 +127,8 @@ public:
void setPasswordHash(
const css::uno::Sequence<sal_Int8>& aPassword,
ScPasswordHash eHash, ScPasswordHash eHash2);
+ void setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount );
bool verifyPassword(const OUString& aPassText) const;
bool isOptionEnabled(SCSIZE nOptId) const;
@@ -325,6 +327,15 @@ void ScTableProtectionImpl::setPasswordHash(
#endif
}
+void ScTableProtectionImpl::setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount )
+{
+ maPasswordHash.maAlgorithmName = rAlgorithmName;
+ maPasswordHash.maHashValue = rHashValue;
+ maPasswordHash.maSaltValue = rSaltValue;
+ maPasswordHash.mnSpinCount = nSpinCount;
+}
+
bool ScTableProtectionImpl::verifyPassword(const OUString& aPassText) const
{
#if DEBUG_TAB_PROTECTION
@@ -562,6 +573,12 @@ void ScDocProtection::setPasswordHash(
mpImpl->setPasswordHash(aPassword, eHash, eHash2);
}
+void ScDocProtection::setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount )
+{
+ mpImpl->setPasswordHash( rAlgorithmName, rHashValue, rSaltValue, nSpinCount);
+}
+
bool ScDocProtection::verifyPassword(const OUString& aPassText) const
{
return mpImpl->verifyPassword(aPassText);
@@ -636,6 +653,12 @@ void ScTableProtection::setPasswordHash(
mpImpl->setPasswordHash(aPassword, eHash, eHash2);
}
+void ScTableProtection::setPasswordHash( const OUString& rAlgorithmName, const OUString& rHashValue,
+ const OUString& rSaltValue, sal_uInt32 nSpinCount )
+{
+ mpImpl->setPasswordHash( rAlgorithmName, rHashValue, rSaltValue, nSpinCount);
+}
+
bool ScTableProtection::verifyPassword(const OUString& aPassText) const
{
return mpImpl->verifyPassword(aPassText);