diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2020-10-27 15:41:02 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-10-30 15:40:12 +0100 |
commit | fdb6d6ccf45e679ff3e369a876482b6801e08e25 (patch) | |
tree | 0593bc4094b18a3baff55c159cb95400958d64c3 /chart2 | |
parent | 58dd58c37912396b0d6ebe21fcd73e2a4fffeb34 (diff) |
tdf#137734 Chart OOXML import: fix variable color charts
generated by third-party tools by setting VaryColorsByPoint,
if the c:varyColors element is missing.
Change-Id: Ia5031d26699b8926054b96ba38320ac848b4f228
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104892
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 19 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdf137734.xlsx | bin | 0 -> 6504 bytes |
2 files changed, 18 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 705c4a69a25f..0cff3a8027be 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -170,6 +170,7 @@ public: void testTdf134111(); void testTdf136752(); void testTdf137505(); + void testTdf137734(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -286,6 +287,7 @@ public: CPPUNIT_TEST(testTdf134111); CPPUNIT_TEST(testTdf136752); CPPUNIT_TEST(testTdf137505); + CPPUNIT_TEST(testTdf137734); CPPUNIT_TEST_SUITE_END(); @@ -1540,7 +1542,7 @@ void Chart2ImportTest::testVaryColorDefaultValues2013XLSX() uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint"); bool bVaryColor = false; CPPUNIT_ASSERT(aAny >>= bVaryColor); - CPPUNIT_ASSERT(bVaryColor); + CPPUNIT_ASSERT(!bVaryColor); } void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX() @@ -2724,6 +2726,21 @@ void Chart2ImportTest::testTdf137505() CPPUNIT_ASSERT_EQUAL(float(12), nFontSize); } +void Chart2ImportTest::testTdf137734() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf137734.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + CPPUNIT_ASSERT(xChartDoc.is()); + Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xDataSeries.is()); + Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint"); + bool bVaryColor = true; + CPPUNIT_ASSERT(aAny >>= bVaryColor); + CPPUNIT_ASSERT(!bVaryColor); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/tdf137734.xlsx b/chart2/qa/extras/data/xlsx/tdf137734.xlsx Binary files differnew file mode 100644 index 000000000000..8c177becc30e --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf137734.xlsx |