summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-02-18 21:44:28 +0100
committerAndras Timar <andras.timar@collabora.com>2015-02-19 15:54:42 +0100
commitdc9135df67a0dc703e7ee2b82a37af2d0e2e8004 (patch)
tree520cb4188d246305269db40b085645120670ef2c
parent3d48f83ef03d3cd49703c00003133aa63aa3c97c (diff)
add test for missing chart area style fill import, tdf#89451
(cherry picked from commit a9924d94e7db6db50b8b36a311f7d7abf80e4700) Conflicts: chart2/qa/extras/chart2import.cxx Change-Id: I052838eaf4134a72feb067fc2a1355fabcafe11f
-rw-r--r--chart2/qa/extras/chart2import.cxx19
-rw-r--r--chart2/qa/extras/data/xlsx/chart-area-style-background.xlsxbin0 -> 13796 bytes
2 files changed, 19 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 7cff8fd1d8e4..c4d29520c774 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -41,6 +41,7 @@ public:
void testSimpleStrictXLSX();
void testDelayedCellImport(); // chart range referencing content on later sheets
void testFlatODSStackedColumnChart();
+ void testChartAreaStyleBackgroundXLSX();
void testNumberFormatsXLSX();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
@@ -67,6 +68,7 @@ public:
CPPUNIT_TEST(testSimpleStrictXLSX);
CPPUNIT_TEST(testDelayedCellImport);
CPPUNIT_TEST(testFlatODSStackedColumnChart);
+ CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
CPPUNIT_TEST(testNumberFormatsXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -386,6 +388,23 @@ void Chart2ImportTest::testFlatODSStackedColumnChart()
// The stacked column chart should consist of 5 data series.
CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aSeriesSeq.getLength());
}
+void Chart2ImportTest::testChartAreaStyleBackgroundXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "chart-area-style-background.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ // "Automatic" chart background fill in xlsx should be loaded as solid white.
+ Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
+ CPPUNIT_ASSERT(xPropSet.is());
+ drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
+ sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get<sal_Int32>();
+ CPPUNIT_ASSERT_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid fill.",
+ eStyle == drawing::FillStyle_SOLID);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'Automatic' chart background fill in xlsx should be loaded as solid white.",
+ sal_Int32(0), nColor);
+}
+
void Chart2ImportTest::testNumberFormatsXLSX()
{
diff --git a/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx b/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx
new file mode 100644
index 000000000000..2baf1e20631c
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx
Binary files differ