[Libreoffice-commits] core.git: sd/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Feb 3 14:27:32 UTC 2021
sd/qa/unit/data/tdf124708.ppt |binary
sd/qa/unit/uiimpress.cxx | 31 +++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
New commits:
commit 83549da20cd1a9ce3b42f1630d2e2f90ab732390
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Feb 3 14:14:42 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Feb 3 15:26:47 2021 +0100
tdf#124708: sd_uiimpress: Add unittest
Change-Id: I82e045af25924179b69e427439bcdbe6a11163b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110347
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sd/qa/unit/data/tdf124708.ppt b/sd/qa/unit/data/tdf124708.ppt
new file mode 100644
index 000000000000..6d29e1acbfee
Binary files /dev/null and b/sd/qa/unit/data/tdf124708.ppt differ
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 8b444d7f3674..db2d6f4c61a3 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -235,6 +235,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf126197)
pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, SfxCallMode::SYNCHRON);
}
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf124708)
+{
+ mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"sd/qa/unit/data/tdf124708.ppt"));
+
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ dispatchCommand(mxComponent, ".uno:NextPage", {});
+ Scheduler::ProcessEventsToIdle();
+
+ checkCurrentPageNumber(2);
+
+ auto pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdPage* pActualPage = pViewShell->GetActualPage();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(16), pActualPage->GetObjCount());
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:Delete", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pActualPage->GetObjCount());
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(16), pActualPage->GetObjCount());
+}
+
CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf139996)
{
mxComponent = loadFromDesktop("private:factory/simpress",
More information about the Libreoffice-commits
mailing list