tdf#156286: sc_uicalc2: Add unittest
Change-Id: Iba1a473293f013e1d5d395ad6ee5f7e61fa759cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155446
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/uicalc/data/tdf156286.ods b/sc/qa/unit/uicalc/data/tdf156286.ods
new file mode 100644
index 0000000..9049e81
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf156286.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx
index 4e154f8..c5207a0 100644
--- a/sc/qa/unit/uicalc/uicalc2.cxx
+++ b/sc/qa/unit/uicalc/uicalc2.cxx
@@ -1180,6 +1180,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152014)
CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc2->GetString(ScAddress(0, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156286)
{
createScDoc("tdf156286.ods");
ScDocument* pDoc = getScDoc();
dispatchCommand(mxComponent, ".uno:SelectAll", {});
// Without the fix in place, this test would have crash here
dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(12, 2, 0)));
dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(OUString("xxxxxxxxxxxx"), pDoc->GetString(ScAddress(12, 2, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf126926)
{
createScDoc();