sd/qa/unit/uiimpress.cxx | 18 ++++++++++++++++++ svx/source/svdraw/svdedxv.cxx | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-)
New commits: commit 1da42db5f3b8e382cc9ea3345a87e7ce495d44d9 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Sun Jun 30 19:37:24 2019 +0200 Commit: Xisco FaulĂ <xiscofa...@libreoffice.org> CommitDate: Mon Jul 1 12:37:46 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 <vmik...@collabora.com> (cherry picked from commit 091f573728e7951d5dc4ef138117499b7480885f) Reviewed-on: https://gerrit.libreoffice.org/74948 Reviewed-by: Xisco FaulĂ <xiscofa...@libreoffice.org> 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 8935d2702804..cb9deae0ed19 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()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits