sc/qa/unit/uicalc/uicalc.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
New commits: commit 5cdee7efe527ffc55c62b3fe3bd2126f727f09f4 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Aug 11 18:12:35 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Aug 11 20:17:42 2025 +0200 tdf#167901: sc_uicalc: Add unittest Change-Id: I5a7321302ebc0f76d00a3cb9b2aa76520fa2f985 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189384 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 0ecc7df641ed..b378a61121c5 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -2334,6 +2334,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf166767) CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xPage->getCount()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf167901) +{ + createScDoc(); + + ScDocument* pDoc = getScDoc(); + + insertNewSheet(*pDoc); + + insertStringToCell(u"A1"_ustr, u"Test"); + + goToCell(u"A1"_ustr); + + dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); + + uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence( + { { "SelectedFormat", uno::Any(static_cast<sal_uInt32>(SotClipboardFormatId::BITMAP)) } }); + + // Without the fix in place, this test would have crashed + dispatchCommand(mxComponent, u".uno:ClipboardFormatItems"_ustr, aPropertyValues); + + ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent); + uno::Reference<drawing::XDrawPage> xPage(pModelObj->getDrawPages()->getByIndex(1), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xPage->getCount()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159174) { createScDoc();