[Libreoffice-commits] core.git: editeng/source

Michael Stahl mstahl at redhat.com
Wed May 3 21:14:58 UTC 2017


 editeng/source/editeng/impedit2.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit a416d8be70f5044143f7de8a1b0cd9d3580ff798
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 3 22:56:20 2017 +0200

    editeng: add pUndoManager assert in ImpEditEngine::~ImpEditEngine()
    
    This too can be an application UndoManager loaned only temporarily
    from getSdrUndoManagerForEnhancedTextEdit() and
    SdrObjEditView::SdrBeginTextEdit() - it must be reset again via
    SdrEndTextEdit().
    
    Change-Id: I1f9d64d7af47ddc53d183bde6a6244ba5c261b0c

diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 6a2a6f950bb6..df975e1eb882 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -193,6 +193,10 @@ ImpEditEngine::~ImpEditEngine()
 
     Dispose();
     delete pEmptyItemSet;
+    // it's only legal to delete the pUndoManager if it was created by
+    // ImpEditEngine; if it was set by SetUndoManager() it must be cleared
+    // before destroying the ImpEditEngine!
+    assert(!pUndoManager || typeid(*pUndoManager) == typeid(EditUndoManager));
     delete pUndoManager;
     delete pTextRanger;
     delete mpIMEInfos;


More information about the Libreoffice-commits mailing list