sc/qa/unit/uicalc/data/tdf138710.ods |binary sc/qa/unit/uicalc/uicalc.cxx | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+)
New commits: commit b49522d96306933dfc94f9e42cc45190514b0af9 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Dec 21 10:55:52 2020 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Dec 21 21:17:59 2020 +0100 tdf#138710: sc_uicalc: Add unittest Change-Id: I5496637baf51035e16fe41d9036de2895d97fed2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108087 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/data/tdf138710.ods b/sc/qa/unit/uicalc/data/tdf138710.ods new file mode 100644 index 000000000000..2a815a7cc3ca Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf138710.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index d87ca61b6765..2376779b32f7 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -93,6 +93,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf122232) checkCurrentCell(2, 6); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138710) +{ + ScModelObj* pModelObj = createDoc("tdf138710.ods"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + + CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1))); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + + CPPUNIT_ASSERT_EQUAL(OUString("Total"), pDoc->GetString(ScAddress(0, 0, 1))); + + dispatchCommand(mxComponent, ".uno:DeleteRows", {}); + + CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1))); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + + CPPUNIT_ASSERT_EQUAL(OUString("Total"), pDoc->GetString(ScAddress(0, 0, 1))); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf133326) { ScModelObj* pModelObj = createDoc("tdf133326.ods"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits