diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-10-08 13:29:12 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-10-12 09:23:28 +0200 |
commit | e0b0502516a10181bbd1737b93b38b2bba4c98e8 (patch) | |
tree | b0571d34dcd0e87d020795c2cd4f016d0ec3b2e7 /oox | |
parent | 2ec58f883bd4d7fe0ac1b716d1abc05cb2b16b4e (diff) |
tdf#128016 Chart OOXML Import: fix duplicated category labels
Do not create category labels if the category axis is deleted.
Regression from commit: fa0a981af41a2606541eec1cb20a379a739691e0
(tdf#114166 DOCX chart import: fix missing complex categories)
Change-Id: If357b95956fccbbc6142879f22ebe1b6d715e850
Reviewed-on: https://gerrit.libreoffice.org/80443
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/drawingml/chart/typegroupmodel.hxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/chart/plotareaconverter.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/typegroupconverter.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/chart/typegroupmodel.cxx | 3 |
4 files changed, 7 insertions, 3 deletions
diff --git a/oox/inc/drawingml/chart/typegroupmodel.hxx b/oox/inc/drawingml/chart/typegroupmodel.hxx index 031ecddf54aa..0803bf4e7a82 100644 --- a/oox/inc/drawingml/chart/typegroupmodel.hxx +++ b/oox/inc/drawingml/chart/typegroupmodel.hxx @@ -76,6 +76,7 @@ struct TypeGroupModel bool mbSmooth; /// True = smooth lines in line charts. bool mbVaryColors; /// True = different automatic colors for each point. bool mbWireframe; /// True = wireframe surface chart, false = filled surface chart. + bool mbCatAxisVisible; /// True = Category axis is visible. explicit TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ); ~TypeGroupModel(); diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index 8afdfda365ea..24ab5f0bfd3e 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -420,6 +420,8 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel ) for (auto const& axesSet : aAxesSets) { + if( !axesSet->maAxes.empty() && mrModel.maTypeGroups.size() > sal::static_int_cast<sal_uInt32>(nAxesSetIdx) ) + mrModel.maTypeGroups[nAxesSetIdx]->mbCatAxisVisible = !axesSet->maAxes[0]->mbDeleted; AxesSetConverter aAxesSetConv(*this, *axesSet); aAxesSetConv.convertFromModel( xDiagram, rView3DModel, nAxesSetIdx, bSupportsVaryColorsByPoint ); if(nAxesSetIdx == nStartAxesSetIdx) diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index ea02d5ca548b..1b6b20865a48 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -272,7 +272,7 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence() first series, even if it was empty. */ for (auto const& elem : mrModel.maSeries) { - if( elem->maSources.has( SeriesModel::CATEGORIES ) ) + if( elem->maSources.has( SeriesModel::CATEGORIES ) && mrModel.mbCatAxisVisible) { SeriesConverter aSeriesConv(*this, *elem); xLabeledSeq = aSeriesConv.createCategorySequence( "categories" ); @@ -287,7 +287,7 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence() } } /* n#839727 Create Category Sequence when none are found */ - if( !xLabeledSeq.is() && !mrModel.maSeries.empty() ) { + if( !xLabeledSeq.is() && !mrModel.maSeries.empty() && mrModel.mbCatAxisVisible) { if( nMaxValues < 0 ) nMaxValues = 2; SeriesModel &aModel = *mrModel.maSeries.get(0); diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx index f9a692c8a39b..aae01ed0f58e 100644 --- a/oox/source/drawingml/chart/typegroupmodel.cxx +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -56,7 +56,8 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mbShowNegBubbles( !bMSO2007Doc ), mbSmooth( !bMSO2007Doc ), mbVaryColors( !bMSO2007Doc ), - mbWireframe( !bMSO2007Doc ) + mbWireframe( !bMSO2007Doc ), + mbCatAxisVisible( !bMSO2007Doc ) { } |