From 4fbc3dbe44857b52677844c47a750abc40713d60 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 9 Aug 2016 18:13:37 +0200 Subject: sw lok: limit undo/redo access to undo actions created by the same view So one view can't undo the changes of an other view by accident. If this is found to be useful in the desktop case, perhaps a dedicated config option can be added for it; for now the behavior is LOK-only. Change-Id: I7ff505d021bd6f6be36953ecc8f8bb971ce8927e Reviewed-on: https://gerrit.libreoffice.org/28007 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit 5d8639aaf2f60157c99c3ee3a8bfa78e4efd010a) --- sw/source/uibase/shells/basesh.cxx | 4 ++-- sw/source/uibase/wrtsh/wrtundo.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source/uibase') diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 0b8fb13380cf..4d3b743de106 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -526,7 +526,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) { case SID_UNDO: { - if (rSh.GetLastUndoInfo(nullptr, nullptr)) + if (rSh.GetLastUndoInfo(nullptr, nullptr, &rSh.GetView())) { rSet.Put( SfxStringItem(nWhich, rSh.GetDoString(SwWrtShell::UNDO))); @@ -537,7 +537,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) } case SID_REDO: { - if (rSh.GetFirstRedoInfo(nullptr)) + if (rSh.GetFirstRedoInfo(nullptr, &rSh.GetView())) { rSet.Put(SfxStringItem(nWhich, rSh.GetDoString(SwWrtShell::REDO))); diff --git a/sw/source/uibase/wrtsh/wrtundo.cxx b/sw/source/uibase/wrtsh/wrtundo.cxx index d8e7ed8498a0..d7da499af1fe 100644 --- a/sw/source/uibase/wrtsh/wrtundo.cxx +++ b/sw/source/uibase/wrtsh/wrtundo.cxx @@ -102,11 +102,11 @@ OUString SwWrtShell::GetDoString( DoType eDoType ) const { case UNDO: nResStr = STR_UNDO; - (void)GetLastUndoInfo(&aUndoStr, nullptr); + (void)GetLastUndoInfo(&aUndoStr, nullptr, &m_rView); break; case REDO: nResStr = STR_REDO; - (void)GetFirstRedoInfo(&aUndoStr); + (void)GetFirstRedoInfo(&aUndoStr, &m_rView); break; default:;//prevent warning } -- cgit v1.2.3