summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-03-15 17:43:20 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-15 18:53:26 +0100
commita42b6236de6df452d1b2341ae6009da3c38bc481 (patch)
tree9ea21a7f5ebec33b48fac2a5f8e291abbf8651ff
parent2aae3ef9ab464b72f6616aa8a66b6f17cae456a4 (diff)
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 <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/unit/uicalc/data/tdf90694.odsbin0 -> 24442 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx21
2 files changed, 21 insertions, 0 deletions
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
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf90694.ods
Binary files 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");