[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Mon Mar 24 15:12:29 PDT 2014


 sc/source/core/data/tabprotection.cxx |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 61df9ee7b13660a21d513f70410e6716c2409e20
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Mar 24 23:07:47 2014 +0100

    made range not editable if password is assigned
    
    ... until we can verify the password.
    
    Change-Id: I3690e9d8c0e07185a0533b669a034581895ab57a

diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx
index 9922151..161cf65 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;
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list