diff options
Diffstat (limited to 'sc/source/ui/view/drawview.cxx')
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
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 |