Kaydet (Commit) 7eba8e98 authored tarafından Eike Rathke's avatar Eike Rathke

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/57060Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 8981adda
...@@ -2487,12 +2487,14 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect ) ...@@ -2487,12 +2487,14 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end(); ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd; ++itr) for (; itr != itrEnd; ++itr)
{
rFunc.ProtectSheet(*itr, rProtect); rFunc.ProtectSheet(*itr, rProtect);
SetTabProtectionSymbol(*itr, true);
}
if (bUndo) if (bUndo)
pDocSh->GetUndoManager()->LeaveListAction(); pDocSh->GetUndoManager()->LeaveListAction();
SetTabProtectionSymbol(nTab, true);
UpdateLayerLocks(); //! broadcast to all views UpdateLayerLocks(); //! broadcast to all views
} }
...@@ -2550,18 +2552,20 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword ) ...@@ -2550,18 +2552,20 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword )
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end(); ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd; ++itr) for (; itr != itrEnd; ++itr)
{
if ( rFunc.Unprotect( *itr, rPassword, false ) ) if ( rFunc.Unprotect( *itr, rPassword, false ) )
bChanged = true; {
bChanged = true;
SetTabProtectionSymbol( *itr, false);
}
}
if (bUndo) if (bUndo)
pDocSh->GetUndoManager()->LeaveListAction(); pDocSh->GetUndoManager()->LeaveListAction();
} }
if (bChanged) if (bChanged)
{
SetTabProtectionSymbol(nTab, false);
UpdateLayerLocks(); //! broadcast to all views UpdateLayerLocks(); //! broadcast to all views
}
return bChanged; return bChanged;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment