diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/drawview.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index 46f5598705f2..aa5e1bbb8533 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -52,8 +52,8 @@ class ScDrawView final : public FmFormView void ImplClearCalcDropMarker(); - // support enhanced text edit for draw objects - virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override; + // Create a local UndoManager + std::unique_ptr<SdrUndoManager> createLocalTextUndoManager() override; public: ScDrawView( diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index c7d12df62209..6959726b4efe 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -1103,10 +1103,13 @@ bool ScDrawView::calculateGridOffsetForB2DRange( return true; } -// support enhanced text edit for draw objects -SdrUndoManager* ScDrawView::getSdrUndoManagerForEnhancedTextEdit() const +// Create a new view-local UndoManager manager for Calc +std::unique_ptr<SdrUndoManager> ScDrawView::createLocalTextUndoManager() { - return pDoc ? dynamic_cast< SdrUndoManager* >(pDoc->GetUndoManager()) : nullptr; + std::unique_ptr<SdrUndoManager> pUndoManager(new SdrUndoManager); + ScDocShell* pDocShell = pViewData ? pViewData->GetDocShell() : nullptr; + pUndoManager->SetDocShell(pDocShell); + return pUndoManager; } // #i123922# helper to apply a Graphic to an existing SdrObject |