tdf#112006: the result is different using getFirstSeries

Restore the old code and use c++11 for-statement

Change-Id: If85793d03fc9f022a938bcd365c605a7ddac2720
Reviewed-on: https://gerrit.libreoffice.org/42031
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2017-09-06 23:26:27 +02:00
committed by Xisco Faulí
parent ba368643e6
commit 493d10b828

View File

@@ -2060,13 +2060,25 @@ uno::Sequence< OUString > VSeriesPlotter::getSeriesNames() const
if( m_xChartTypeModel.is() )
aRole = m_xChartTypeModel->getRoleOfSequenceForSeriesLabel();
VDataSeries* pFirstSeries = getFirstSeries();
uno::Reference<XDataSeries> xSeries(pFirstSeries ? pFirstSeries->getModel() : nullptr);
if (xSeries.is())
for (std::vector<VDataSeriesGroup> const & rGroup : m_aZSlots)
{
OUString aSeriesName(DataSeriesHelper::getDataSeriesLabel(xSeries, aRole));
aRetVector.push_back(aSeriesName);
std::vector<VDataSeriesGroup>::const_iterator aXSlotIter = rGroup.begin();
const std::vector<VDataSeriesGroup>::const_iterator aXSlotEnd = rGroup.end();
if (aXSlotIter != aXSlotEnd)
{
VDataSeriesGroup aSeriesGroup(*aXSlotIter);
if (aSeriesGroup.m_aSeriesVector.size())
{
VDataSeries* pSeries = aSeriesGroup.m_aSeriesVector[0];
uno::Reference< XDataSeries > xSeries( pSeries ? pSeries->getModel() : nullptr );
if( xSeries.is() )
{
OUString aSeriesName( DataSeriesHelper::getDataSeriesLabel( xSeries, aRole ) );
aRetVector.push_back( aSeriesName );
}
}
}
}
return comphelper::containerToSequence( aRetVector );
}