summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-03-11 12:26:46 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-03-11 13:32:26 +0100
commit36a169c10f0457c30a0d327fda585c4decb33532 (patch)
tree7b946877a37d7a122ef68aadd160b28e709cf587 /sc
parent9f428717f97d2d129a4e3e9e9428245b6621c3f7 (diff)
tdf#159373: sc_uicalc: Add unittest
Change-Id: I30e452534e09aa349a85f0862ed09291506203dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164654 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/uicalc/data/tdf159373.odsbin0 -> 32546 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf159373.ods b/sc/qa/unit/uicalc/data/tdf159373.ods
new file mode 100644
index 000000000000..6dc7a110e3fa
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf159373.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 1bf9dfc12883..f792cc0dcd1f 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1684,6 +1684,26 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706)
CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 2, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159373)
+{
+ createScDoc("tdf159373.ods");
+ ScDocument* pDoc = getScDoc();
+
+ 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());
+
+ dispatchCommand(mxComponent, ".uno:Undo", aArgs);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount());
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf86166)
{
createScDoc("tdf86166.ods");