summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-03-24 23:07:47 +0100
committerEike Rathke <erack@redhat.com>2014-03-24 23:11:59 +0100
commit61df9ee7b13660a21d513f70410e6716c2409e20 (patch)
treee267ec1b1bbecc1fb77318f0507ec6e63daa34df /sc
parente387169daa1b560360e8670a677e233ab2287e61 (diff)
made range not editable if password is assigned
... until we can verify the password. Change-Id: I3690e9d8c0e07185a0533b669a034581895ab57a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/tabprotection.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx
index 9922151a53e6..161cf652f478 100644
--- a/sc/source/core/data/tabprotection.cxx
+++ b/sc/source/core/data/tabprotection.cxx
@@ -385,6 +385,11 @@ bool ScTableProtectionImpl::updateReference( UpdateRefMode eMode, ScDocument* pD
bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
{
+ /* TODO: ask for password (and remember) if mnPasswordVerifier was set for
+ * a matching range and no matching range without password was encountered.
+ * Would need another return type than boolean to reflect
+ * "password required for a specific protection". */
+
// No protection exception or overriding permission to edit if empty.
if (maEnhancedProtection.empty())
return false;
@@ -400,7 +405,11 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
if ((*it).maSecurityDescriptor.empty() && (*it).maRangeList.Is())
{
if ((*it).maRangeList->In( rRange))
- return true;
+ {
+ // Range is editable if no password is assigned.
+ if (!(*it).mnPasswordVerifier)
+ return true;
+ }
}
}
@@ -417,7 +426,11 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange ) const
{
ScRangeList aList( (*it).maRangeList->GetIntersectedRange( rRange));
if (aList.size() == 1 && *aList[0] == rRange)
- return true;
+ {
+ // Range is editable if no password is assigned.
+ if (!(*it).mnPasswordVerifier)
+ return true;
+ }
}
}