summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-13 13:21:54 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-13 17:40:51 +0200
commited99b776d59d6293a97e61dc5284619cc873e35b (patch)
tree3b9259cb4db4c92d46fedb57bdf910c9469783c7 /sd
parentba42683fada2abafa18a49cd50ce8298b92851c8 (diff)
tdf#151417: sd_uiimpress: Add unittest
Change-Id: I8f5f957557612ce78036d962968a3e9fef113cf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141291 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/uiimpress.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index fafd3fe4cc56..627a652da622 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -899,6 +899,31 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf38669)
CPPUNIT_ASSERT_EQUAL(OUString(u"°"), xShape->getString());
}
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf151417)
+{
+ mxComponent = loadFromDesktop("private:factory/simpress",
+ "com.sun.star.presentation.PresentationDocument");
+ auto pImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pImpressDocument);
+
+ uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws = xDrawPagesSupplier->getDrawPages();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
+
+ uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDrawPage->getCount());
+
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "KeyModifier", uno::Any(KEY_MOD1) } }));
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:Edit", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
+}
+
CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841)
{
// To check if selecting unfilled rectangle produces unfilled rectangle