[Libreoffice-commits] core.git: sd/qa svx/source

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 1 07:45:50 UTC 2019


 sd/qa/unit/uiimpress.cxx      |   18 ++++++++++++++++++
 svx/source/svdraw/svdedxv.cxx |    2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 091f573728e7951d5dc4ef138117499b7480885f
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Sun Jun 30 19:37:24 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jul 1 09:45:10 2019 +0200

    tdf#125824 svx: fix crash with view1 and view2 doing textedit
    
    Similar to 3a874f1c80c37e8b35666e1d73161ff762eb7e4c
    
    Change-Id: I51bffa4d33e82bb90b8a42787f55c12746bcd8c2
    Reviewed-on: https://gerrit.libreoffice.org/74931
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 2d3710faa7ed..b8d9017b2cf9 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -19,6 +19,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <svl/intitem.hxx>
 #include <svx/svxids.hrc>
+#include <svl/stritem.hxx>
 
 #include <DrawDocShell.hxx>
 #include <ViewShell.hxx>
@@ -100,6 +101,23 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522)
     // Without the accompanying fix in place, this test would have failed with an assertion failure
     // in SdrObjEditView::SdrEndTextEdit() as mpOldTextEditUndoManager was not nullptr.
     pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_UNDO, SfxCallMode::SYNCHRON);
+
+    // Start text edit in window 2.
+    // tdf#125824
+    pView2->MarkObj(pShape2, pView2->GetSdrPageView());
+    pView2->SdrBeginTextEdit(pShape2);
+    CPPUNIT_ASSERT(pView2->IsTextEdit());
+    // Write 'test' inside the shape
+    SfxStringItem aInputString(SID_ATTR_CHAR, "test");
+    pViewShell2->GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_CHAR, SfxCallMode::SYNCHRON,
+                                                              { &aInputString });
+    CPPUNIT_ASSERT(pView2->GetTextEditObject());
+    EditView& rEditView = pView2->GetTextEditOutlinerView()->GetEditView();
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), rEditView.GetSelection().nStartPos);
+    pView2->SdrEndTextEdit();
+    // Without the accompanying fix in place, this test would have failed with an assertion failure
+    // in SdrObjEditView::SdrEndTextEdit() as mpOldTextEditUndoManager was not nullptr.
+    pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_UNDO, SfxCallMode::SYNCHRON);
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f4d3f8eee8aa..5163f943e8bb 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1475,7 +1475,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
             pTEOutliner->SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
             pTEOutliner->SetEndPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
 
-            const bool bUndo = IsUndoEnabled();
+            const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
             if( bUndo )
             {
                 OUString aObjName(pTEObj->TakeObjNameSingul());


More information about the Libreoffice-commits mailing list