sc/qa/unit/uicalc/data/tdf124820.xlsx |binary sc/qa/unit/uicalc/uicalc.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+)
New commits: commit 5447cbd11a4aba6a0de3f379107655d3f94b838e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu May 19 13:35:36 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu May 19 16:10:14 2022 +0200 tdf#124820: sc_uicalc: Add unittest Change-Id: Ib5c5ce333d9bc1b436454aae1f181e4f1ec73b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134637 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/uicalc/data/tdf124820.xlsx b/sc/qa/unit/uicalc/data/tdf124820.xlsx new file mode 100644 index 000000000000..60d50271678d Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf124820.xlsx differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 6cf4c18a3bea..5251f579a978 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -787,6 +787,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119162) pDoc->GetString(ScAddress(0, 0, 0))); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124820) +{ + ScModelObj* pModelObj = createDoc("tdf124820.xlsx"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + goToCell("B2"); + + dispatchCommand(mxComponent, ".uno:Strikeout", {}); + Scheduler::ProcessEventsToIdle(); + + pModelObj = saveAndReload(mxComponent, "Calc Office Open XML"); + pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + vcl::Font aFont; + const ScPatternAttr* pPattern = pDoc->GetPattern(1, 1, 0); + pPattern->GetFont(aFont, SC_AUTOCOL_RAW); + + // Without the fix in place, this test would have failed here + CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be striked out", STRIKEOUT_SINGLE, + aFont.GetStrikeout()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119155) { ScModelObj* pModelObj = createDoc("tdf119155.xlsx");