diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-14 12:12:32 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-14 20:51:03 +0200 |
commit | 4d85d2d482f640a4b5d66995e099895cff6f9c77 (patch) | |
tree | 76b9c81a1d55b7cf4931bc351fdb749e91b33b54 | |
parent | be714ddd3048ab41d653c3fbd13c83079e44c198 (diff) |
tdf#133327: sc_subsequent_filters_test: Add unittest
Change-Id: Icf8fff02fd0ad9576cb9773ca18a228a42daa34f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102659
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sc/qa/unit/data/ods/tdf133327.ods | bin | 0 -> 7313 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf133327.ods b/sc/qa/unit/data/ods/tdf133327.ods Binary files differnew file mode 100644 index 000000000000..164391488fa5 --- /dev/null +++ b/sc/qa/unit/data/ods/tdf133327.ods diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 81a222051835..0f0f39a419c0 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -222,6 +222,7 @@ public: void testHiddenSheetsXLSX(); void testRelFormulaValidationXLS(); void testTdf130132(); + void testTdf133327(); void testColumnStyle2XLSX(); void testAutofilterXLSX(); @@ -389,6 +390,7 @@ public: CPPUNIT_TEST(testRefStringXLSX); CPPUNIT_TEST(testRelFormulaValidationXLS); CPPUNIT_TEST(testTdf130132); + CPPUNIT_TEST(testTdf133327); CPPUNIT_TEST(testColumnStyle2XLSX); CPPUNIT_TEST(testAutofilterXLSX); @@ -3572,6 +3574,25 @@ void ScFiltersTest::testTdf130132() } } +void ScFiltersTest::testTdf133327() +{ + ScDocShellRef xDocSh = loadDoc("tdf133327.", FORMAT_ODS); + CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is()); + + ScDocument& rDoc = xDocSh->GetDocument(); + + const ScPatternAttr* pAttr = rDoc.GetPattern(250, 1, 0); + + const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND); + const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem); + const Color& rColor = rBackground.GetColor(); + + // Without the fix in place, this test would have failed with + // - Expected: Color: R:255 G:255 B: 0 + // - Actual : Color: R:255 G:255 B: 255 + CPPUNIT_ASSERT_EQUAL(Color(255, 255, 0), rColor); +} + void ScFiltersTest::testColumnStyle2XLSX() { ScDocShellRef xDocSh = loadDoc("column_style.", FORMAT_XLSX); |