summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-08-09 18:47:05 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-08-11 13:04:31 +0200
commit2b2e8471727f0825bb18df58be86a9252de4432e (patch)
tree0cdb8d441fc8a24c519054470a602b19a4d990af /sc
parentcad5220c707ab7483e9146182e3353146ae24d41 (diff)
tdf#150219: sc_uicalc: Add unittest
Change-Id: I94aeecb156485095fda476480ead3db1979f3c1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138060 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index be1a8cfc4b9b..25d16a4d1201 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1945,6 +1945,29 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf108654)
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount());
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf150219)
+{
+ mxComponent = loadFromDesktop("private:factory/scalc");
+ ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+ CPPUNIT_ASSERT(pModelObj);
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ insertNewSheet(*pDoc);
+
+ insertStringToCell(*pModelObj, "A1", "=$Sheet1.A1");
+ goToCell("A1");
+
+ CPPUNIT_ASSERT_EQUAL(OUString("0"), pDoc->GetString(ScAddress(0, 0, 1)));
+
+ dispatchCommand(mxComponent, ".uno:ShowPrecedents", {});
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:Cut", {});
+
+ CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 0, 1)));
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf133326)
{
ScModelObj* pModelObj = createDoc("tdf133326.ods");