diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/tdf126197.odp | bin | 0 -> 10501 bytes | |||
-rw-r--r-- | sd/qa/unit/uiimpress.cxx | 31 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 5 |
3 files changed, 36 insertions, 0 deletions
diff --git a/sd/qa/unit/data/tdf126197.odp b/sd/qa/unit/data/tdf126197.odp Binary files differnew file mode 100644 index 000000000000..cbe5b074464f --- /dev/null +++ b/sd/qa/unit/data/tdf126197.odp 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 (); |