summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 6cc4d81eba25..d6982192a4f5 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -291,11 +291,14 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
if( nMaxValues < 0 )
nMaxValues = 2;
SeriesModel &aModel = *mrModel.maSeries.get(0);
- DataSourceModel &aSrc = aModel.maSources.create( SeriesModel::CATEGORIES );
- DataSequenceModel &aSeq = aSrc.mxDataSeq.create();
- aSeq.mnPointCount = nMaxValues;
- for( sal_Int32 i = 0; i < nMaxValues; i++ )
- aSeq.maData[ i ] <<= OUString::number( i + 1 );
+ if (!aModel.maSources.has(SeriesModel::CATEGORIES))
+ {
+ DataSourceModel &aSrc = aModel.maSources.create( SeriesModel::CATEGORIES );
+ DataSequenceModel &aSeq = aSrc.mxDataSeq.create();
+ aSeq.mnPointCount = nMaxValues;
+ for( sal_Int32 i = 0; i < nMaxValues; i++ )
+ aSeq.maData[ i ] <<= OUString::number( i + 1 );
+ }
SeriesConverter aSeriesConv( *this, aModel );
xLabeledSeq = aSeriesConv.createCategorySequence( "categories" );
}