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

Eike Rathke erack at redhat.com
Fri Jul 6 15:11:50 UTC 2018


 sc/source/ui/view/viewfunc.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 7eba8e98508d547f43fecbe3175a11a05956b30a
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Jul 6 14:53:10 2018 +0200

    Related: tdf#118547 handle multi-sheet un-/protect, tdf#95880 follow-up
    
    Also don't attempt to remove a lock for TABLEID_DOC that is not a
    sheet.
    
    Change-Id: I28775a068215a59063ed95fd141e125cf2155aa7
    Reviewed-on: https://gerrit.libreoffice.org/57060
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index a4091418909d..6d306164cb82 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2487,12 +2487,14 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
 
     ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
     for (; itr != itrEnd; ++itr)
+    {
         rFunc.ProtectSheet(*itr, rProtect);
+        SetTabProtectionSymbol(*itr, true);
+    }
 
     if (bUndo)
         pDocSh->GetUndoManager()->LeaveListAction();
 
-    SetTabProtectionSymbol(nTab, true);
     UpdateLayerLocks();         //! broadcast to all views
 }
 
@@ -2550,18 +2552,20 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword )
 
         ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
         for (; itr != itrEnd; ++itr)
+        {
             if ( rFunc.Unprotect( *itr, rPassword, false ) )
-                    bChanged = true;
+            {
+                bChanged = true;
+                SetTabProtectionSymbol( *itr, false);
+            }
+        }
 
         if (bUndo)
             pDocSh->GetUndoManager()->LeaveListAction();
     }
 
     if (bChanged)
-    {
-        SetTabProtectionSymbol(nTab, false);
         UpdateLayerLocks();     //! broadcast to all views
-    }
 
     return bChanged;
 }


More information about the Libreoffice-commits mailing list