diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-12-21 10:55:52 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-12-21 21:17:59 +0100 |
commit | b49522d96306933dfc94f9e42cc45190514b0af9 (patch) | |
tree | 074ac427f0ecd6af55912b6a37ee7a0b28d31d69 /sc | |
parent | 78021844ef340aefe7d80f5b262ed038078ebf1e (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/uicalc/data/tdf138710.ods | bin | 0 -> 13950 bytes | |||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf138710.ods b/sc/qa/unit/uicalc/data/tdf138710.ods Binary files differnew file mode 100644 index 000000000000..2a815a7cc3ca --- /dev/null +++ b/sc/qa/unit/uicalc/data/tdf138710.ods 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"); |