[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 14 18:51:45 UTC 2020


 sc/qa/unit/data/ods/tdf133327.ods      |binary
 sc/qa/unit/subsequent_filters-test.cxx |   21 +++++++++++++++++++++
 2 files changed, 21 insertions(+)

New commits:
commit 4d85d2d482f640a4b5d66995e099895cff6f9c77
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Sep 14 12:12:32 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Sep 14 20:51:03 2020 +0200

    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 at libreoffice.org>

diff --git a/sc/qa/unit/data/ods/tdf133327.ods b/sc/qa/unit/data/ods/tdf133327.ods
new file mode 100644
index 000000000000..164391488fa5
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf133327.ods differ
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);


More information about the Libreoffice-commits mailing list