summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_filters-test.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-03-24 10:17:39 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-24 21:39:42 +0100
commit6cc9f2ee740f51bf49e031135ce7c44d19cefe9c (patch)
treec18adc8d94e9675d979fc55e8547eb2e24fc7869 /sc/qa/unit/subsequent_filters-test.cxx
parent3a09ac34dbe61d4f675956ef9e07de75cf5cfef2 (diff)
tdf#101104: sc_subsequent_filters: Add unittest
Change-Id: Ifd39b958d011db0ca1575bc340bc23983075062d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113025 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/unit/subsequent_filters-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 09d0f6df601a..fd55c00f6a89 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -162,6 +162,7 @@ public:
void testCondFormatThemeColor2XLSX(); // negative bar color and axis color
void testCondFormatThemeColor3XLSX(); // theme index 2 and 3 are switched
void testComplexIconSetsXLSX();
+ void testTdf101104();
void testTdf64401();
void testCondFormatParentXLSX();
void testColorScaleNumWithRefXLSX();
@@ -376,6 +377,7 @@ public:
CPPUNIT_TEST(testCondFormatThemeColor2XLSX);
CPPUNIT_TEST(testCondFormatThemeColor3XLSX);
CPPUNIT_TEST(testComplexIconSetsXLSX);
+ CPPUNIT_TEST(testTdf101104);
CPPUNIT_TEST(testTdf64401);
CPPUNIT_TEST(testCondFormatParentXLSX);
CPPUNIT_TEST(testColorScaleNumWithRefXLSX);
@@ -2806,6 +2808,37 @@ void ScFiltersTest::testComplexIconSetsXLSX()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf101104()
+{
+ ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc(u"tdf101104.", FORMAT_ODS);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load tdf101104.ods", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT_EQUAL(size_t(2), rDoc.GetCondFormList(0)->size());
+
+ ScConditionalFormat* pFormat = rDoc.GetCondFormat(1, 1, 0);
+ CPPUNIT_ASSERT(pFormat);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+ const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+ CPPUNIT_ASSERT(pEntry);
+ CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
+ const ScIconSetFormat* pIconSet = static_cast<const ScIconSetFormat*>(pEntry);
+
+ for(size_t i = 1; i < 10; ++i)
+ {
+ std::unique_ptr<ScIconSetInfo> pInfo(pIconSet->GetIconSetInfo(ScAddress(1, i, 0)));
+
+ // Without the fix in place, this test would have failed here
+ CPPUNIT_ASSERT(pInfo);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), pInfo->nIconIndex);
+ CPPUNIT_ASSERT_EQUAL(IconSet_3Arrows, pInfo->eIconSetType);
+
+ }
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testTdf64401()
{
ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc(u"tdf64401.", FORMAT_ODS);