summaryrefslogtreecommitdiff
path: root/sw/source/core/draw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-10-07 16:48:46 +0200
committerTomaž Vajngerl <quikee@gmail.com>2021-10-20 16:25:16 +0200
commitc175c1dc19d0edc8ca66e39f0b4b8af04e3d6c87 (patch)
tree04e074d7e034642a4e4025e106dc20db09ca9ee2 /sw/source/core/draw
parent85d53dafd8332fc9c7bf71d6cc9da19ab9d8e252 (diff)
svx: Don't end text edit mode for all views
This allows multiple views to not disturb each other editing inside a impress document. With the ending of text edit for all views still enabled, one view can cancel other views text editing just by moving or resizing a unrelated shape in the document. To make this possible we also need a view-local undo manager for the text edit mode, which is independent of the document undo manager. When the text edit mode ends, all the changes will be added as one change to the document undo stack. This prevents any conflicts in the undo stack that could be made when 2 views are editing the same document at the same time. This also adds the test for the new use case and changes the existing tests to reflect the change. Change-Id: I04edb4f91d7e111a490c946f7121cbca75f818d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123220 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/core/draw')
-rw-r--r--sw/source/core/draw/dview.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 33d6a83fb1f8..510addf10a9c 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -998,12 +998,12 @@ void SwDrawView::DeleteMarked()
pTmpRoot->EndAllAction();
}
-// support enhanced text edit for draw objects
-SdrUndoManager* SwDrawView::getSdrUndoManagerForEnhancedTextEdit() const
+// Create a new view-local UndoManager manager for Writer
+std::unique_ptr<SdrUndoManager> SwDrawView::createLocalTextUndoManager()
{
- SwDoc* pDoc = Imp().GetShell()->GetDoc();
-
- return pDoc ? &(pDoc->GetUndoManager()) : nullptr;
+ std::unique_ptr<SdrUndoManager> pUndoManager(new SdrUndoManager);
+ pUndoManager->SetDocShell(SfxObjectShell::Current());
+ return pUndoManager;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */