diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-22 05:49:39 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-22 05:52:27 +0100 |
commit | cd033b12cc50f48459b23faf68e96976c5882e7f (patch) | |
tree | b8fcbd5f8fecf5bf63224013b019386db0e043a7 | |
parent | 9f2acf24bf5b7d3c7f4482d0d63d9a7ad9d5481d (diff) |
we only support simple labels in the InternalDataProvider, bnc#864396
Change-Id: Ie31c5c73bb5185125fd4493c4e476997e2e9bc63
-rw-r--r-- | oox/source/drawingml/chart/datasourceconverter.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx index 6be4710ad72c..ea22348c3cc0 100644 --- a/oox/source/drawingml/chart/datasourceconverter.cxx +++ b/oox/source/drawingml/chart/datasourceconverter.cxx @@ -50,6 +50,34 @@ Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUSt Reference< XDataSequence > xDataSeq; if( getChartConverter() ) { + // the internal data table does not support complex labels + // this is only supported in Calc!!! + // merge the labels into a single one + if(rRole == "label") + { + mrModel.mnPointCount = std::min<sal_Int32>(mrModel.mnPointCount, 1); + OUStringBuffer aTitle; + bool bFirst = true; + for(DataSequenceModel::AnyMap::const_iterator itr = mrModel.maData.begin(), + itrEnd = mrModel.maData.end(); itr != itrEnd; ++itr) + { + Any aAny = itr->second; + if(aAny.has<OUString>()) + { + if(!bFirst) + aTitle.append(" "); + + aTitle.append(aAny.get<OUString>()); + bFirst = false; + } + } + + if(!bFirst) + { + mrModel.maData.clear(); + mrModel.maData.insert(std::make_pair<sal_Int32, Any>(1, Any(aTitle.makeStringAndClear()))); + } + } xDataSeq = getChartConverter()->createDataSequence( getChartDocument()->getDataProvider(), mrModel ); // set sequen ce role |