summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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