summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-16 07:02:02 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-16 07:26:40 +0200
commit883c81033fea0d9adb5c31b345908859b9f18db9 (patch)
tree08ff95fee56c8047ad314a922f6dbdcd1ff65b87 /sc
parentc02f3174f7e5e6ed32379d727d4a362420a01d56 (diff)
add test for new icon sets during XLSX import
Change-Id: I923aff04f8349aa25b49fd2eba6c29bfd579b4a7
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/complex_icon_set.xlsxbin0 -> 9189 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx31
2 files changed, 31 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/complex_icon_set.xlsx b/sc/qa/unit/data/xlsx/complex_icon_set.xlsx
new file mode 100644
index 000000000000..32f1e52f6944
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/complex_icon_set.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 849ac9f3f300..dab0033fd146 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -136,6 +136,7 @@ public:
void testNewCondFormatXLSX();
void testCondFormatThemeColorXLSX();
void testCondFormatThemeColor2XLSX(); // negative bar color and axis color
+ void testComplexIconSetsXLSX();
void testLiteralInFormulaXLS();
@@ -244,6 +245,7 @@ public:
CPPUNIT_TEST(testNewCondFormatXLSX);
CPPUNIT_TEST(testCondFormatThemeColorXLSX);
CPPUNIT_TEST(testCondFormatThemeColor2XLSX);
+ CPPUNIT_TEST(testComplexIconSetsXLSX);
CPPUNIT_TEST(testLiteralInFormulaXLS);
CPPUNIT_TEST(testNumberFormatHTML);
@@ -2406,6 +2408,35 @@ void ScFiltersTest::testCondFormatThemeColor2XLSX()
CPPUNIT_ASSERT_EQUAL(Color(197, 90, 17), pDataBarFormatData->maAxisColor);
}
+namespace {
+
+void testComplexIconSetsXLSX_Impl(ScDocument& rDoc, SCCOL nCol, ScIconSetType eType)
+{
+ ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 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(condformat::ICONSET, pEntry->GetType());
+ const ScIconSetFormat* pIconSet = static_cast<const ScIconSetFormat*>(pEntry);
+ CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
+}
+
+}
+
+void ScFiltersTest::testComplexIconSetsXLSX()
+{
+ ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc( "complex_icon_set.", XLSX );
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load complex_icon_set.xlsx", xDocSh.Is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT_EQUAL(size_t(3), rDoc.GetCondFormList(0)->size());
+ testComplexIconSetsXLSX_Impl(rDoc, 1, IconSet_3Triangles);
+ testComplexIconSetsXLSX_Impl(rDoc, 3, IconSet_3Stars);
+ testComplexIconSetsXLSX_Impl(rDoc, 5, IconSet_5Boxes);
+}
+
void ScFiltersTest::testLiteralInFormulaXLS()
{
ScDocShellRef xDocSh = loadDoc("shared-string/literal-in-formula.", XLS);