diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-01-09 16:24:50 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-01-10 14:09:34 +0100 |
commit | c9b7ead4cd0b74bdd4bbb364afc245c6299d74c9 (patch) | |
tree | 0a8128d36cd5699c3c922b247e8f519268c18d79 /sc | |
parent | 496386d34ba5f55a6a7724929e83374f6a4a9eef (diff) |
tdf#158254: sc_uicalc2: Add unittest
Change-Id: Ifc2bac24958cc0330d8174079886851ff1c0c990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161834
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit ef6ff2df2e1286974da2f344aa3b8e3ae9093a79)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161854
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/uicalc/uicalc2.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx index 9be6d83840bb..a488749e9835 100644 --- a/sc/qa/unit/uicalc/uicalc2.cxx +++ b/sc/qa/unit/uicalc/uicalc2.cxx @@ -13,6 +13,7 @@ #include <svx/svdpage.hxx> #include <vcl/keycodes.hxx> #include <vcl/scheduler.hxx> +#include <stlsheet.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> @@ -87,6 +88,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf150499) CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf158254) +{ + createScDoc(); + ScDocument* pDoc = getScDoc(); + + goToCell("A:G"); + dispatchCommand(mxComponent, + ".uno:StyleApply?Style:string=Accent%201&FamilyName:string=CellStyles", {}); + + const ScPatternAttr* pPattern = pDoc->GetPattern(5, 0, 0); + ScStyleSheet* pStyleSheet = const_cast<ScStyleSheet*>(pPattern->GetStyleSheet()); + + // Without the fix in place, this test would have failed with + // - Expected: Accent 1 + // - Actual : Default + CPPUNIT_ASSERT_EQUAL(OUString("Accent 1"), pStyleSheet->GetName()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + + pPattern = pDoc->GetPattern(5, 0, 0); + pStyleSheet = const_cast<ScStyleSheet*>(pPattern->GetStyleSheet()); + CPPUNIT_ASSERT_EQUAL(OUString("Default"), pStyleSheet->GetName()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf133326) { createScDoc("tdf133326.ods"); |