diff options
author | Eike Rathke <erack@redhat.com> | 2018-07-06 20:09:55 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-08 22:36:36 +0200 |
commit | dc9c326c378f252df83aa90a61df51a60d574c8c (patch) | |
tree | e75c437bb804b6b294f740e91da47890f4399c60 | |
parent | 2bd85bfd98203cc11e2391e01e9f8d70a9037214 (diff) |
tdf#118547: Remove lock mark only if password is correct, tdf#95880 follow-up
This is a combination of 3 commits.
tdf#118547: Remove lock mark only if password is correct
Reviewed-on: https://gerrit.libreoffice.org/57044
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit c3a732a11c320b98e31dad79f421d4d73f33a15b)
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.
Reviewed-on: https://gerrit.libreoffice.org/57060
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 7eba8e98508d547f43fecbe3175a11a05956b30a)
Handle protection lock mark in Undo/Redo, tdf#68290 follow-up
Reviewed-on: https://gerrit.libreoffice.org/57063
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 6fb449d127d1da165f610c4c99c2c7d9c5afbb97)
Change-Id: I9f5731dfaaf9b4cc67e600a8b1c01709e7c9ba99
28775a068215a59063ed95fd141e125cf2155aa7
c88cb375f9f6030c9268fca84de7a5434bb82dc1
Reviewed-on: https://gerrit.libreoffice.org/57091
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/source/ui/undo/undotab.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index db0c34d0568c..f8bd5dc6940b 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -1254,6 +1254,8 @@ void ScUndoTabProtect::DoProtect(bool bProtect) ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) { + if (ScTabView* pTabView = pViewShell->GetViewData().GetView()) + pTabView->SetTabProtectionSymbol( mnTab, bProtect); pViewShell->UpdateLayerLocks(); pViewShell->UpdateInputHandler(true); // so that input can be immediately entered again } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 27e9ad05d738..3f6e583c6f60 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2489,12 +2489,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 } @@ -2552,15 +2554,18 @@ 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(); } - SetTabProtectionSymbol(nTab, false); - if (bChanged) UpdateLayerLocks(); //! broadcast to all views |