sc/qa/unit/uicalc/data/tdf154991.ods |binary sc/qa/unit/uicalc/uicalc.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+)
New commits: commit 3fa2ba3b557f2415f94cc22cc4b3495d9226df72 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Apr 25 10:53:40 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Apr 25 13:03:08 2023 +0200 tdf#154991: sc_uicalc: Add unittest Change-Id: I1aa8e56fdbf0b8903cd04b78f4bb640fb31bd56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150963 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/data/tdf154991.ods b/sc/qa/unit/uicalc/data/tdf154991.ods new file mode 100644 index 000000000000..bcbd42a17036 Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf154991.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index dcf74b8790f6..0d3920edbab9 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1290,6 +1290,22 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf146994) CPPUNIT_ASSERT_EQUAL(OUString("Sheet1.D3:Sheet1.D4"), aMarkedAreaString); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf154991) +{ + createScDoc("tdf154991.ods"); + ScDocument* pDoc = getScDoc(); + + goToCell("A1"); + dispatchCommand(mxComponent, ".uno:SelectColumn", {}); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:HideColumn", {}); + CPPUNIT_ASSERT(pDoc->ColHidden(0, 0)); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0)); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf95306) { createScDoc();