diff options
author | Eike Rathke <erack@redhat.com> | 2018-07-06 14:53:10 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-07-06 17:11:18 +0200 |
commit | 7eba8e98508d547f43fecbe3175a11a05956b30a (patch) | |
tree | f3ff6a9d97ab62996eda498b5fb75422a469c77d /sc | |
parent | 8981adda6a24a172245b8cd0dd60e31644e23c75 (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
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
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; } |