sc/qa/unit/uicalc/data/tdf156286.ods |binary sc/qa/unit/uicalc/uicalc2.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+)
New commits: commit d27c206faa600444d2753d1f2596b6ca83b4c117 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Aug 8 11:31:22 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Aug 8 20:21:58 2023 +0200 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 <xiscofa...@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 000000000000..9049e8170d7c Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf156286.ods differ diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx index 4e154f8bbb83..c5207a03c3d8 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();