diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-05-14 04:42:02 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-05-14 05:33:27 +0200 |
commit | 6439999fcb7d359fda57e3e5d51474a94d70ab57 (patch) | |
tree | 29f6d0c473b873173efebd8259ea60450576f809 | |
parent | 83120950d5138577185598f5eaf8a267d2244dd1 (diff) |
add test for negative data bar theme color
Includes test for work-around for Excel bug.
Change-Id: Iee51241725c827b20b1ecaa8b5dc8144860749c2
-rw-r--r-- | sc/qa/unit/data/xlsx/cond_format_theme_color2.xlsx | bin | 0 -> 8470 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/cond_format_theme_color2.xlsx b/sc/qa/unit/data/xlsx/cond_format_theme_color2.xlsx Binary files differnew file mode 100644 index 000000000000..61c0d585350a --- /dev/null +++ b/sc/qa/unit/data/xlsx/cond_format_theme_color2.xlsx diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 12bb93a03c72..1ec7460dd4bd 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -135,6 +135,7 @@ public: void testNewCondFormatODS(); void testNewCondFormatXLSX(); void testCondFormatThemeColorXLSX(); + void testCondFormatThemeColor2XLSX(); // negative bar color and axis color void testLiteralInFormulaXLS(); @@ -242,6 +243,7 @@ public: CPPUNIT_TEST(testNewCondFormatODS); CPPUNIT_TEST(testNewCondFormatXLSX); CPPUNIT_TEST(testCondFormatThemeColorXLSX); + CPPUNIT_TEST(testCondFormatThemeColor2XLSX); CPPUNIT_TEST(testLiteralInFormulaXLS); CPPUNIT_TEST(testNumberFormatHTML); @@ -2380,6 +2382,27 @@ void ScFiltersTest::testCondFormatThemeColorXLSX() CPPUNIT_ASSERT_EQUAL(Color(157, 195, 230), pColorScaleEntry->GetColor()); } +void ScFiltersTest::testCondFormatThemeColor2XLSX() +{ + ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc( "cond_format_theme_color2.", XLSX ); + + CPPUNIT_ASSERT_MESSAGE("Failed to load cond_format_theme_color2.xlsx", xDocSh.Is()); + + ScDocument& rDoc = xDocSh->GetDocument(); + ScConditionalFormat* pFormat = rDoc.GetCondFormat(5, 5, 0); + CPPUNIT_ASSERT(pFormat); + const ScFormatEntry* pEntry = pFormat->GetEntry(0); + CPPUNIT_ASSERT(pEntry); + CPPUNIT_ASSERT_EQUAL(pEntry->GetType(), condformat::DATABAR); + const ScDataBarFormat* pDataBar = static_cast<const ScDataBarFormat*>(pEntry); + const ScDataBarFormatData* pDataBarFormatData = pDataBar->GetDataBarData(); + + CPPUNIT_ASSERT_EQUAL(Color(99, 142, 198), pDataBarFormatData->maPositiveColor); + CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor.get()); + CPPUNIT_ASSERT_EQUAL(Color(217, 217, 217), *pDataBarFormatData->mpNegativeColor.get()); + CPPUNIT_ASSERT_EQUAL(Color(197, 90, 17), pDataBarFormatData->maAxisColor); +} + void ScFiltersTest::testLiteralInFormulaXLS() { ScDocShellRef xDocSh = loadDoc("shared-string/literal-in-formula.", XLS); |