diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-09-11 14:14:13 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-09-18 13:24:46 +0200 |
commit | 2d51b9fd4e7b22a21c77cff473de56ebebc5c9f2 (patch) | |
tree | 8d126c86f7dee7e975aea59583b06365805a1eb2 /oox | |
parent | 49667a6950709856b9a1a5d59ca78fdf682a53f4 (diff) |
tdf#136267 OOXML Chart Import: create main category axis labels once
because InternalDataProvider can not handle different category names
on the primary and secondary category axis.
Revert e0b0502516a10181bbd1737b93b38b2bba4c98e8 commit, except
the relevant unit test.
Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8
(tdf#128016 Chart OOXML Import: fix duplicated category labels)
Also fix tdf#129994 (FILEOPEN - hang at import time), which is a
a regression from commit fa0a981af41a2606541eec1cb20a379a739691e0
(tdf#114166 DOCX chart import: fix missing complex categories)
Change-Id: I5d049e760eb1a647ea774be264349a2f16f15f5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102463
Tested-by: László Németh <nemeth@numbertext.org>
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/axisconverter.cxx | 5 | ||||
-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 |
5 files changed, 7 insertions, 8 deletions
diff --git a/oox/inc/drawingml/chart/typegroupmodel.hxx b/oox/inc/drawingml/chart/typegroupmodel.hxx index 79d55dfd2846..5a37797e1b25 100644 --- a/oox/inc/drawingml/chart/typegroupmodel.hxx +++ b/oox/inc/drawingml/chart/typegroupmodel.hxx @@ -74,7 +74,6 @@ 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/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index d73632476550..8599c68e6732 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -208,7 +208,10 @@ void AxisConverter::convertFromModel( // tdf#132076: set axis type to date, if it is a date axis! aScaleData.AxisType = bDateAxis ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY; aScaleData.AutoDateAxis = mrModel.mbAuto; - aScaleData.Categories = rTypeGroups.front()->createCategorySequence(); + /* TODO: create main category axis labels once, while InternalDataProvider + can not handle different category names on the primary and secondary category axis. */ + if( nAxesSetIdx == 0 ) + aScaleData.Categories = rTypeGroups.front()->createCategorySequence(); /* set default ShiftedCategoryPosition values for some charttype, because the XML can contain wrong CrossBetween value, if came from MSO */ if( rTypeGroups.front()->is3dChart() && (rTypeInfo.meTypeId == TYPEID_BAR || rTypeInfo.meTypeId == TYPEID_HORBAR || rTypeInfo.meTypeId == TYPEID_STOCK) ) diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index e5f337a94193..8a8a721a1fe9 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -422,8 +422,6 @@ 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 47e2f351608a..f6cea5df9b38 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -271,7 +271,7 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence() first series, even if it was empty. */ for (auto const& elem : mrModel.maSeries) { - if( elem->maSources.has( SeriesModel::CATEGORIES ) && mrModel.mbCatAxisVisible) + if( elem->maSources.has( SeriesModel::CATEGORIES ) ) { SeriesConverter aSeriesConv(*this, *elem); xLabeledSeq = aSeriesConv.createCategorySequence( "categories" ); @@ -286,7 +286,7 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence() } } /* n#839727 Create Category Sequence when none are found */ - if( !xLabeledSeq.is() && !mrModel.maSeries.empty() && mrModel.mbCatAxisVisible) { + if( !xLabeledSeq.is() && !mrModel.maSeries.empty() ) { 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 0edd189e27a6..cc106a5de118 100644 --- a/oox/source/drawingml/chart/typegroupmodel.cxx +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -54,8 +54,7 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mbShowNegBubbles( !bMSO2007Doc ), mbSmooth( !bMSO2007Doc ), mbVaryColors( !bMSO2007Doc ), - mbWireframe( !bMSO2007Doc ), - mbCatAxisVisible( true ) + mbWireframe( !bMSO2007Doc ) { } |