summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJean-Tiare Le Bigot <admin@jtlebi.fr>2016-10-13 23:43:41 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-11-06 06:02:27 +0000
commit4bcf1872bbe9db1388769485a7e4c0cbcce3d53c (patch)
tree0110875cf6db25b7208099e9394995254111b221 /oox
parent17e9dc436bc6ad8d3a5bbde15d4d47262650aa2c (diff)
chartx: fix sparse chart import
Change-Id: I1bcd2257da900c6a88bc78040fabe5696e2bab7d Reviewed-on: https://gerrit.libreoffice.org/29801 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/chart/chartconverter.cxx9
-rw-r--r--oox/source/drawingml/chart/datasourceconverter.cxx2
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx1
3 files changed, 6 insertions, 6 deletions
diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx
index d49430245e7f..ff43fa7a5460 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -133,11 +133,10 @@ Reference< XDataSequence > ChartConverter::createDataSequence(
if( !rDataSeq.maData.empty() )
{
// create a single-row array from constant source data
- Matrix< Any > aMatrix( rDataSeq.maData.size(), 1 );
- Matrix< Any >::iterator aMIt = aMatrix.begin();
- // TODO: how to handle missing values in the map?
- for( DataSequenceModel::AnyMap::const_iterator aDIt = rDataSeq.maData.begin(), aDEnd = rDataSeq.maData.end(); aDIt != aDEnd; ++aDIt, ++aMIt )
- *aMIt = aDIt->second;
+ Matrix< Any > aMatrix( rDataSeq.mnPointCount, 1 );
+ for( DataSequenceModel::AnyMap::const_iterator aDIt = rDataSeq.maData.begin(), aDEnd = rDataSeq.maData.end(); aDIt != aDEnd; ++aDIt )
+ *aMatrix.at(aDIt->first, 0) = aDIt->second;
+
aRangeRep = lclGenerateApiArray( aMatrix );
}
diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx
index 2c3dbcf7b1fb..738e7051a409 100644
--- a/oox/source/drawingml/chart/datasourceconverter.cxx
+++ b/oox/source/drawingml/chart/datasourceconverter.cxx
@@ -69,7 +69,7 @@ Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUSt
if(!bFirst)
{
mrModel.maData.clear();
- mrModel.maData.insert(std::make_pair<sal_Int32, Any>(1, Any(aTitle.makeStringAndClear())));
+ mrModel.maData.insert(std::make_pair<sal_Int32, Any>(0, Any(aTitle.makeStringAndClear())));
}
}
xDataSeq = getChartConverter().createDataSequence(getChartDocument()->getDataProvider(), mrModel, rRole);
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index e39fba78686e..f6c88e763376 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -296,6 +296,7 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
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 );
SeriesConverter aSeriesConv( *this, aModel );