From a9924d94e7db6db50b8b36a311f7d7abf80e4700 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 18 Feb 2015 21:44:28 +0100 Subject: add test for missing chart area style fill import, tdf#89451 Change-Id: I052838eaf4134a72feb067fc2a1355fabcafe11f --- chart2/qa/extras/chart2import.cxx | 19 +++++++++++++++++++ .../data/xlsx/chart-area-style-background.xlsx | Bin 0 -> 13796 bytes 2 files changed, 19 insertions(+) create mode 100644 chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 45fe8659a4c1..1eaa74de11de 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -56,6 +56,7 @@ public: void testFdo54361(); void testFdo54361_1(); void testAutoBackgroundXLSX(); + void testChartAreaStyleBackgroundXLSX(); // void testTextCanOverlapXLSX(); // TODO : temporarily disabled. void testNumberFormatsXLSX(); @@ -87,6 +88,7 @@ public: CPPUNIT_TEST(testFdo54361); CPPUNIT_TEST(testFdo54361_1); CPPUNIT_TEST(testAutoBackgroundXLSX); + CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX); // CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled. CPPUNIT_TEST(testNumberFormatsXLSX); CPPUNIT_TEST_SUITE_END(); @@ -639,6 +641,23 @@ void Chart2ImportTest::testAutoBackgroundXLSX() (nColor & 0x00FFFFFF) == 0x00FFFFFF); // highest 2 bytes are transparency which we ignore here. } +void Chart2ImportTest::testChartAreaStyleBackgroundXLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "chart-area-style-background.xlsx"); + uno::Reference 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 xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get(); + sal_Int32 nColor = xPropSet->getPropertyValue("FillColor").get(); + 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); +} + /* TODO : temporarily disabled. void Chart2ImportTest::testTextCanOverlapXLSX() { 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 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart-area-style-background.xlsx differ -- cgit