From e98f19e598951a54561a7f414a209260b5e79a39 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Tue, 18 Jun 2019 15:53:11 +0200 Subject: tdf#124817 OOXML chart import: fix missing symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OOXML chart symbols with undefined fill color attribute were imported as invisible white symbols. Fixed by using line color of these symbols. Change-Id: Ie4314ed56b63daa82fe30b111aeae9e358ff2b4b Reviewed-on: https://gerrit.libreoffice.org/74286 Tested-by: Jenkins Reviewed-by: László Németh --- chart2/qa/extras/chart2import.cxx | 32 ++++++++++++++++++++++++++++++ chart2/qa/extras/data/xlsx/tdf124817.xlsx | Bin 0 -> 20868 bytes 2 files changed, 32 insertions(+) create mode 100644 chart2/qa/extras/data/xlsx/tdf124817.xlsx (limited to 'chart2') diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index a55107b36318..803e99e773da 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -71,6 +73,7 @@ public: void testTdf106217(); void testTdf108021(); void testTdf100084(); + void testTdf124817(); void testAutoBackgroundXLSX(); void testAutoChartAreaBorderPropXLSX(); void testChartAreaStyleBackgroundXLSX(); @@ -163,6 +166,7 @@ public: CPPUNIT_TEST(testTdf106217); CPPUNIT_TEST(testTdf108021); CPPUNIT_TEST(testTdf100084); + CPPUNIT_TEST(testTdf124817); CPPUNIT_TEST(testAutoBackgroundXLSX); CPPUNIT_TEST(testAutoChartAreaBorderPropXLSX); CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX); @@ -901,6 +905,34 @@ void Chart2ImportTest::testTdf100084() CPPUNIT_ASSERT_MESSAGE("There should be a Diagram.", xDiagram.is()); } +void Chart2ImportTest::testTdf124817() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf124817.xlsx"); + Reference xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + uno::Reference xDataSeries; + chart2::Symbol aSymblProp; + + // Check the symbol of data series 1 (marker style none) + xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropSet_0(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT((xPropSet_0->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.Style == chart2::SymbolStyle_NONE)); + + // Check the symbol of data series 2 (marker style square) + xDataSeries = getDataSeriesFromDoc(xChartDoc, 1); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropSet_1(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT((xPropSet_1->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.FillColor == static_cast(0xED7D31))); + + // Check the symbol of data series 3 (marker style diagonal cross) + xDataSeries = getDataSeriesFromDoc(xChartDoc, 2); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference xPropSet_2(xDataSeries, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.BorderColor == static_cast(0xFF0000))); +} + void Chart2ImportTest::testTransparentBackground(OUString const & filename) { load("/chart2/qa/extras/data/xlsx/", filename); diff --git a/chart2/qa/extras/data/xlsx/tdf124817.xlsx b/chart2/qa/extras/data/xlsx/tdf124817.xlsx new file mode 100644 index 000000000000..d9b09644e47e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf124817.xlsx differ -- cgit