sc/qa/unit/uicalc/data/tdf150499.xls |binary sc/qa/unit/uicalc/uicalc.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+)
New commits: commit 4a003f37b4d71a06f915858690d40c6f3c6fa1bc Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Sep 6 11:39:19 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Sep 6 12:43:30 2022 +0200 tdf#150499: sc_uicalc: Add unittest Change-Id: Id2aae130c3b9ede1fe88893d035a37b82b0964f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139478 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/data/tdf150499.xls b/sc/qa/unit/uicalc/data/tdf150499.xls new file mode 100644 index 000000000000..1b7289a6ee26 Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf150499.xls differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 25d16a4d1201..ab258894eb16 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1968,6 +1968,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf150219) CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1))); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf150499) +{ + ScModelObj* pModelObj = createDoc("tdf150499.xls"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount()); + + uno::Sequence<beans::PropertyValue> aArgs( + comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } })); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Remove", aArgs); + + CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf133326) { ScModelObj* pModelObj = createDoc("tdf133326.ods");