chart2/qa/extras/chart2import.cxx | 19 ++++++++++++++++++- chart2/qa/extras/data/xlsx/tdf137734.xlsx |binary oox/source/drawingml/chart/axismodel.cxx | 2 +- oox/source/drawingml/chart/typegroupmodel.cxx | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-)
New commits: commit fdb6d6ccf45e679ff3e369a876482b6801e08e25 Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Tue Oct 27 15:41:02 2020 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Fri Oct 30 15:40:12 2020 +0100 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 <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> 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 new file mode 100644 index 000000000000..8c177becc30e Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf137734.xlsx differ diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx index d84c707eba01..0159810dfc1f 100644 --- a/oox/source/drawingml/chart/axismodel.cxx +++ b/oox/source/drawingml/chart/axismodel.cxx @@ -49,7 +49,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mnTickMarkSkip( 0 ), mnTypeId( nTypeId ), mbAuto( false ), - mbDeleted( !bMSO2007Doc ), + mbDeleted( false ), mbNoMultiLevel( false ) { } diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx index cc106a5de118..9479f93c4939 100644 --- a/oox/source/drawingml/chart/typegroupmodel.cxx +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -53,7 +53,7 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mbShowMarker( !bMSO2007Doc ), mbShowNegBubbles( !bMSO2007Doc ), mbSmooth( !bMSO2007Doc ), - mbVaryColors( !bMSO2007Doc ), + mbVaryColors( false ), mbWireframe( !bMSO2007Doc ) { } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits