summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-07-06 14:53:10 +0200
committerEike Rathke <erack@redhat.com>2018-07-06 22:19:10 +0200
commit3eeb0096ac7c5beb48441eabc032cde38745a549 (patch)
tree6129ba3e4b7ead8404669c7ed5ee68634d4ef2cf
parent16fcf30fa53a55fdcd82826fd4d73bbd1b6bd883 (diff)
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@redhat.com> Tested-by: Jenkins (cherry picked from commit 7eba8e98508d547f43fecbe3175a11a05956b30a) Reviewed-on: https://gerrit.libreoffice.org/57071
-rw-r--r--sc/source/ui/view/viewfunc.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index e7c8be1aa0d9..0b5103924185 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,8 +2552,13 @@ 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();