sc/qa/unit/uicalc/data/tdf90694.ods |binary sc/qa/unit/uicalc/uicalc.cxx | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+)
New commits: commit a42b6236de6df452d1b2341ae6009da3c38bc481 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Mar 15 17:43:20 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Mar 15 18:53:26 2022 +0100 tdf#90694: sc_uicalc: Add unittest Change-Id: I93c845a811e24e6ed79d1fb8264b5057a1e660a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131619 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/data/tdf90694.ods b/sc/qa/unit/uicalc/data/tdf90694.ods new file mode 100644 index 000000000000..dfb427102dbd Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf90694.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 1409c0c7a534..69282fcd0661 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1401,6 +1401,27 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117458) pMod->SetInputOptions(aInputOption); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf90694) +{ + ScModelObj* pModelObj = createDoc("tdf90694.ods"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + // Select row 30 to 60 + goToCell("30:60"); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + + CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 29, 0))); + CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 59, 0))); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + + CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), pDoc->GetString(ScAddress(0, 29, 0))); + CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), pDoc->GetString(ScAddress(0, 59, 0))); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138710) { ScModelObj* pModelObj = createDoc("tdf138710.ods");