sc/qa/unit/uicalc/uicalc.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
New commits: commit b2e4123cfd597ef19eebcb1d2a98c058eea990b2 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Oct 18 10:47:59 2021 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Oct 18 13:16:17 2021 +0200 tdf#145085: sc_uicalc: Add unittest Change-Id: I47e0199ea2a3268697b42c26daec906a165ae3a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123734 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 8a17d18b4f87..3c3d15f1d399 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -232,6 +232,24 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143896) CPPUNIT_ASSERT_EQUAL(OUString("Test"), pDoc->GetString(ScAddress(0, 1999, 0))); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf145085) +{ + mxComponent = loadFromDesktop("private:factory/scalc"); + ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get()); + CPPUNIT_ASSERT(pModelObj); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + insertStringToCell(*pModelObj, "A1", "=HYPERLINK(\"a\";\"b\")", true); + + CPPUNIT_ASSERT_EQUAL(OUString("b"), pDoc->GetString(ScAddress(0, 0, 0))); + + // Without the fix in place, this test would have failed with + // - Expected: + // - Actual : a + CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0))); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100582) { ScModelObj* pModelObj = createDoc("tdf100582.xls");