summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-11-11 08:41:50 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-11-11 09:57:20 +0100
commit2875c65946e59f5dd7968155463bf00bd71d440b (patch)
tree3461382a09bb7f576b33c551ddbbd8dd0fb4bf93 /svl
parentf69ce5f15e7fcae0b595e90631fd5ae2c76ed750 (diff)
sw, out of order undo: allow a subset of a non-empty redo list
Specifically, we used to not allow out of order undo at all if the redo list was non-empty. This relaxes that condition a bit. Out of order undo is OK with a non-empty redo list, in case all undo actions in the redo list are either 1) owned by the current view or 2) independent from the undo action to be executed I.e. if view1 has lots of type undo actions and an view2 adds a single type undo action on top of it, then allow view 1 to execute multiple of its typing undo actions, not just a single one. Change-Id: I2f5d9404a9994ed74b65233d2a315976c27b28b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125023 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'svl')
-rw-r--r--svl/source/undo/undo.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 0c081b152c3a..f84d2cda185a 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -747,7 +747,7 @@ size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel )
}
-SfxUndoAction* SfxUndoManager::GetRedoAction() const
+SfxUndoAction* SfxUndoManager::GetRedoAction(size_t nNo) const
{
UndoManagerGuard aGuard( *m_xData );
@@ -756,7 +756,7 @@ SfxUndoAction* SfxUndoManager::GetRedoAction() const
{
return nullptr;
}
- return pUndoArray->maUndoActions[ pUndoArray->nCurUndoAction ].pAction.get();
+ return pUndoArray->maUndoActions[pUndoArray->nCurUndoAction + nNo].pAction.get();
}