[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sd/qa sd/source
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 5 08:53:30 UTC 2019
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 5d610afe67ef0d692703deee9559eaf9a362cbe3
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jul 2 17:36:50 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Aug 5 10:52:54 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Ă <xiscofauli at libreoffice.org>
(cherry picked from commit 80db66c4f345ac469943f871308b14b7f5ed0a11)
Reviewed-on: https://gerrit.libreoffice.org/75079
(cherry picked from commit e79dbb8c6c4d2cf1ce2cf0ce67c53ed4bb09898b)
Reviewed-on: https://gerrit.libreoffice.org/75615
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
(cherry picked from commit cbc54319369fc4bf1566bc4f46e53e38ef4e74ae)
Reviewed-on: https://gerrit.libreoffice.org/76942
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
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 0d89b22eb3bd..0fc5e3f06b03 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -812,6 +812,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();
@@ -986,6 +990,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
}
else
{
+ mpDrawView->EndTextEditAllViews();
FuDeleteSelectedObjects();
}
rReq.Ignore ();
More information about the Libreoffice-commits
mailing list