diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-05-03 21:58:37 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-05-03 22:44:31 +0200 |
commit | f5a89dac29f745527ed8c437d4a138ebd0f2f4f8 (patch) | |
tree | 034f98e87ac351d0f6d492b612c70d4cc6831e93 | |
parent | d499cb3bd585e9fcc21bc586cad3d2ad2487a451 (diff) |
svx: SdrObjEditView is not the owner of mpOldTextEditUndoManager
In all of sc, sd, sw, the UndoManager returned by
getSdrUndoManagerForEnhancedTextEdit() is owned by the application
and SdrObjEditView should leave its grubby paws off of it.
Change-Id: I7be3d336e0aaf4905323c1e99ff0643b3844f295
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index c49fd72c03af..0e7f9ec3543a 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -100,7 +100,7 @@ SdrObjEditView::~SdrObjEditView() if (IsTextEdit()) SdrEndTextEdit(); delete pTextEditOutliner; - delete mpOldTextEditUndoManager; + assert(nullptr == mpOldTextEditUndoManager); // should have been reset } @@ -952,13 +952,7 @@ bool SdrObjEditView::SdrBeginTextEdit( // we have an outliner, undo manager and it's an EditUndoManager, exchange // the document undo manager and the default one from the outliner and tell // it that text edit starts by setting a callback if it needs to end text edit mode. - if(mpOldTextEditUndoManager) - { - // should not happen, delete it since it was probably forgotten somewhere - OSL_ENSURE(false, "Deleting forgotten old TextEditUndoManager, should be checked (!)"); - delete mpOldTextEditUndoManager; - mpOldTextEditUndoManager = nullptr; - } + assert(nullptr == mpOldTextEditUndoManager); mpOldTextEditUndoManager = pTextEditOutliner->SetUndoManager(pSdrUndoManager); pSdrUndoManager->SetEndTextEditHdl(LINK(this, SdrObjEditView, EndTextEditHdl)); @@ -1065,6 +1059,10 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) } } } + else + { + assert(nullptr == mpOldTextEditUndoManager); // cannot be restored! + } if( GetModel() && mxTextEditObj.is() ) { |