sd/qa/unit/data/tdf126197.odp |binary sd/qa/unit/uiimpress.cxx | 31 +++++++++++++++++++++++++++++++ sd/source/ui/view/drviewse.cxx | 5 +++++ 3 files changed, 36 insertions(+)
New commits: commit 80db66c4f345ac469943f871308b14b7f5ed0a11 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Jul 2 17:36:50 2019 +0200 Commit: Xisco FaulĂ <xiscofa...@libreoffice.org> CommitDate: Thu Jul 4 14:25:03 2019 +0200 tdf#126197: EndTextEdit on all views before delete/cut shape Change-Id: I3da93e5c72ee6f6f99120758e870d654e01a0ec7 Reviewed-on: https://gerrit.libreoffice.org/75001 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ <xiscofa...@libreoffice.org> diff --git a/sd/qa/unit/data/tdf126197.odp b/sd/qa/unit/data/tdf126197.odp new file mode 100644 index 000000000000..cbe5b074464f Binary files /dev/null and b/sd/qa/unit/data/tdf126197.odp differ diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index b8d9017b2cf9..2125820c7c50 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -120,6 +120,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522) pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_UNDO, SfxCallMode::SYNCHRON); } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf126197) +{ + // Load the document and create two new windows. + mxComponent = loadFromDesktop(m_directories.getURLFromSrc("sd/qa/unit/data/tdf126197.odp")); + auto pImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); + sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell(); + pViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_NEWWINDOW, SfxCallMode::SYNCHRON); + sd::ViewShell* pViewShell1 = pImpressDocument->GetDocShell()->GetViewShell(); + pViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_NEWWINDOW, SfxCallMode::SYNCHRON); + sd::ViewShell* pViewShell2 = pImpressDocument->GetDocShell()->GetViewShell(); + CPPUNIT_ASSERT(pViewShell1 != pViewShell2); + + // Start text edit in window 1. + SdPage* pPage1 = pViewShell1->GetActualPage(); + SdrObject* pShape1 = pPage1->GetObj(0); + SdrView* pView1 = pViewShell1->GetView(); + pView1->MarkObj(pShape1, pView1->GetSdrPageView()); + pView1->SdrBeginTextEdit(pShape1); + CPPUNIT_ASSERT(pView1->IsTextEdit()); + + SdPage* pPage2 = pViewShell2->GetActualPage(); + CPPUNIT_ASSERT_EQUAL(pPage1, pPage2); + SdrObject* pShape2 = pPage2->GetObj(0); + CPPUNIT_ASSERT_EQUAL(pShape1, pShape2); + SdrView* pView2 = pViewShell2->GetView(); + pView2->MarkObj(pShape2, pView2->GetSdrPageView()); + + // Without the accompanying fix in place, this test would have failed with an assertion failure + // in SdrObjEditView::SdrEndTextEdit() + pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, SfxCallMode::SYNCHRON); +} CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 0c9ee3867fec..9cebd8c4f0d8 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -824,6 +824,10 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) } else { + //tdf#126197: EndTextEdit in all views if current one is not in TextEdit + if ( !mpDrawView->IsTextEdit() ) + mpDrawView->EndTextEditAllViews(); + if(HasCurrentFunction()) { GetCurrentFunction()->DoCut(); @@ -998,6 +1002,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) } else { + mpDrawView->EndTextEditAllViews(); FuDeleteSelectedObjects(); } rReq.Ignore (); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits