summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-12-17 23:00:24 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-18 07:36:32 +0100
commit4e144751f12a06e358e4f7efa7c8f13954e6cfd7 (patch)
treec6df66d58d02ecaf5caa437a944665fe83959402 /chart2
parentconvert EEHorizontalTextDirection to scoped enum (diff)
downloadcore-4e144751f12a06e358e4f7efa7c8f13954e6cfd7.tar.gz
core-4e144751f12a06e358e4f7efa7c8f13954e6cfd7.zip
loplugin:unusedindex
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx5
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx40
-rw-r--r--chart2/source/tools/XMLRangeHelper.cxx6
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx100
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx103
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx37
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx51
-rw-r--r--chart2/source/view/charttypes/NetChart.cxx96
8 files changed, 162 insertions, 276 deletions
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index fa64f29277fe..ff9ecc746ebd 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -217,11 +217,10 @@ sal_Int16 SAL_CALL CreationWizardUnoDlg::execute( )
void SAL_CALL CreationWizardUnoDlg::initialize( const uno::Sequence< uno::Any >& aArguments )
{
- const uno::Any* pArguments = aArguments.getConstArray();
- for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
+ for(const uno::Any& rArgument : aArguments)
{
beans::PropertyValue aProperty;
- if(*pArguments >>= aProperty)
+ if(rArgument >>= aProperty)
{
if( aProperty.Name == "ParentWindow" )
{
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 7ade8542e4b7..768b75c7ca3c 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -196,31 +196,29 @@ void DataSourceHelper::readArguments( const uno::Sequence< beans::PropertyValue
, OUString & rRangeRepresentation, uno::Sequence< sal_Int32 >& rSequenceMapping
, bool& bUseColumns, bool& bFirstCellAsLabel, bool& bHasCategories )
{
- const beans::PropertyValue* pArguments = rArguments.getConstArray();
- for(sal_Int32 i=0; i<rArguments.getLength(); ++i, ++pArguments)
+ for(const beans::PropertyValue& rProperty : rArguments)
{
- const beans::PropertyValue& aProperty = *pArguments;
- if ( aProperty.Name == "DataRowSource" )
+ if ( rProperty.Name == "DataRowSource" )
{
css::chart::ChartDataRowSource eRowSource;
- if( aProperty.Value >>= eRowSource )
+ if( rProperty.Value >>= eRowSource )
bUseColumns = (eRowSource==css::chart::ChartDataRowSource_COLUMNS);
}
- else if ( aProperty.Name == "FirstCellAsLabel" )
+ else if ( rProperty.Name == "FirstCellAsLabel" )
{
- aProperty.Value >>= bFirstCellAsLabel;
+ rProperty.Value >>= bFirstCellAsLabel;
}
- else if ( aProperty.Name == "HasCategories" )
+ else if ( rProperty.Name == "HasCategories" )
{
- aProperty.Value >>= bHasCategories;
+ rProperty.Value >>= bHasCategories;
}
- else if ( aProperty.Name == "CellRangeRepresentation" )
+ else if ( rProperty.Name == "CellRangeRepresentation" )
{
- aProperty.Value >>= rRangeRepresentation;
+ rProperty.Value >>= rRangeRepresentation;
}
- else if ( aProperty.Name == "SequenceMapping" )
+ else if ( rProperty.Name == "SequenceMapping" )
{
- aProperty.Value >>= rSequenceMapping;
+ rProperty.Value >>= rSequenceMapping;
}
}
}
@@ -398,26 +396,24 @@ bool DataSourceHelper::allArgumentsForRectRangeDetected(
{
const uno::Sequence< beans::PropertyValue > aArguments(
xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument )));
- const beans::PropertyValue* pArguments = aArguments.getConstArray();
- for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
+ for(const beans::PropertyValue& rProperty : aArguments)
{
- const beans::PropertyValue& aProperty = *pArguments;
- if ( aProperty.Name == "DataRowSource" )
+ if ( rProperty.Name == "DataRowSource" )
{
bHasDataRowSource =
- (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(
+ (rProperty.Value.hasValue() && rProperty.Value.isExtractableTo(
cppu::UnoType<css::chart::ChartDataRowSource>::get()));
}
- else if ( aProperty.Name == "FirstCellAsLabel" )
+ else if ( rProperty.Name == "FirstCellAsLabel" )
{
bHasFirstCellAsLabel =
- (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(cppu::UnoType<bool>::get()));
+ (rProperty.Value.hasValue() && rProperty.Value.isExtractableTo(cppu::UnoType<bool>::get()));
}
- else if ( aProperty.Name == "CellRangeRepresentation" )
+ else if ( rProperty.Name == "CellRangeRepresentation" )
{
OUString aRange;
bHasCellRangeRepresentation =
- (aProperty.Value.hasValue() && (aProperty.Value >>= aRange) && !aRange.isEmpty());
+ (rProperty.Value.hasValue() && (rProperty.Value >>= aRange) && !aRange.isEmpty());
}
}
}
diff --git a/chart2/source/tools/XMLRangeHelper.cxx b/chart2/source/tools/XMLRangeHelper.cxx
index 95d91181d2e7..72f9df8c6280 100644
--- a/chart2/source/tools/XMLRangeHelper.cxx
+++ b/chart2/source/tools/XMLRangeHelper.cxx
@@ -296,17 +296,15 @@ CellRange getCellRangeFromXMLString( const OUString & rXMLString )
static const sal_Unicode aDollar( '$' );
static const sal_Unicode aBackslash( '\\' );
- sal_Int32 nStartPos = 0;
- sal_Int32 nEndPos = nStartPos;
const sal_Int32 nLength = rXMLString.getLength();
// reset
CellRange aResult;
// iterate over different ranges
- for( sal_Int32 i = 0;
+ for( sal_Int32 nStartPos = 0, nEndPos = nStartPos;
nEndPos < nLength;
- nStartPos = ++nEndPos, i++ )
+ nStartPos = ++nEndPos )
{
// find start point of next range
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index d0bf32064738..2a8d773244e0 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -530,44 +530,34 @@ void AreaChart::impl_createSeriesShapes()
//the polygon shapes for each series need to be created before
//iterate through all series again to create the series shapes
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
-
std::map< sal_Int32, drawing::PolyPolygonShape3D* > aPreviousSeriesPolyMap;//a PreviousSeriesPoly for each different nAttachedAxisIndex
drawing::PolyPolygonShape3D* pSeriesPoly = nullptr;
//iterate through all series
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
PlotterBase::m_pPosHelper = pPosHelper;
- createRegressionCurvesShapes( **aSeriesIter, m_xErrorBarTarget, m_xRegressionCurveEquationTarget,
+ createRegressionCurvesShapes( *pSeries, m_xErrorBarTarget, m_xRegressionCurveEquationTarget,
m_pPosHelper->maySkipPointsInRegressionCalculation());
- pSeriesPoly = &(*aSeriesIter)->m_aPolyPolygonShape3D;
+ pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
if( m_bArea )
{
- if( !impl_createArea( *aSeriesIter, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
+ if( !impl_createArea( pSeries, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
continue;
}
if( m_bLine )
{
- if( !impl_createLine( *aSeriesIter, pSeriesPoly, pPosHelper ) )
+ if( !impl_createLine( pSeries, pSeriesPoly, pPosHelper ) )
continue;
}
aPreviousSeriesPolyMap[nAttachedAxisIndex] = pSeriesPoly;
@@ -666,25 +656,14 @@ void AreaChart::createShapes()
bool bDateCategory = (m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis());
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
std::vector<std::map< sal_Int32, double > > aLogicYSumMapByX(nEndIndex);//one for each different nAttachedAxisIndex
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::iterator aXSlotEnd = aZSlotIter->end();
-
//iterate through all x slots in this category to get 100percent sum
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::iterator aSeriesIter = rSeriesList.begin();
- std::vector<VDataSeries*>::iterator aSeriesEnd = rSeriesList.end();
-
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -711,31 +690,23 @@ void AreaChart::createShapes()
}
}
- aZSlotIter = m_aZSlots.begin();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ sal_Int32 nZ=1;
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::const_iterator aXSlotIter = aZSlotIter->begin();
- std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
//for the area chart there should be at most one x slot (no side by side stacking available)
//attention different: xSlots are always interpreted as independent areas one behind the other: @todo this doesn't work why not???
- for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, ++nX )
+ for( auto const& rXSlot : rZSlot )
{
- const std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::const_iterator aSeriesIter = rSeriesList.begin();
- const std::vector<VDataSeries*>::const_iterator aSeriesEnd = rSeriesList.end();
-
std::vector<std::map< sal_Int32, double > > aLogicYForNextSeriesMapByX(nEndIndex); //one for each different nAttachedAxisIndex
//iterate through all series
- for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; ++aSeriesIter, ++nSeriesIndex )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(*aSeriesIter, m_xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(pSeries, m_xSeriesTarget);
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
@@ -743,7 +714,7 @@ void AreaChart::createShapes()
if(m_nDimension==3)
fLogicZ = nZ+0.5;
- (*aSeriesIter)->m_fLogicZPos = fLogicZ;
+ pSeries->m_fLogicZPos = fLogicZ;
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
@@ -751,16 +722,16 @@ void AreaChart::createShapes()
/* #i70133# ignore points outside of series length in standard area
charts. Stacked area charts will use missing points as zeros. In
standard charts, pSeriesList contains only one series. */
- if( m_bArea && (rSeriesList.size() == 1) && (nIndex >= (*aSeriesIter)->getTotalPointCount()) )
+ if( m_bArea && (rXSlot.m_aSeriesVector.size() == 1) && (nIndex >= pSeries->getTotalPointCount()) )
continue;
//collect data point information (logic coordinates, style ):
- double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ double fLogicX = pSeries->getXValue(nIndex);
if (bDateCategory)
fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution );
- double fLogicY = (*aSeriesIter)->getYValue(nIndex);
+ double fLogicY = pSeries->getYValue(nIndex);
- if( m_nDimension==3 && m_bArea && rSeriesList.size()!=1 )
+ if( m_nDimension==3 && m_bArea && rXSlot.m_aSeriesVector.size()!=1 )
fLogicY = fabs( fLogicY );
std::map< sal_Int32, double >& rLogicYSumMap = aLogicYSumMapByX[nIndex];
@@ -773,10 +744,10 @@ void AreaChart::createShapes()
|| ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY)
|| ::rtl::math::isNan(fLogicZ) || ::rtl::math::isInf(fLogicZ) )
{
- if( (*aSeriesIter)->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
+ if( pSeries->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
{
- drawing::PolyPolygonShape3D& rPolygon = (*aSeriesIter)->m_aPolyPolygonShape3D;
- sal_Int32& rIndex = (*aSeriesIter)->m_nPolygonIndex;
+ drawing::PolyPolygonShape3D& rPolygon = pSeries->m_aPolyPolygonShape3D;
+ sal_Int32& rIndex = pSeries->m_nPolygonIndex;
if( 0<= rIndex && rIndex < rPolygon.SequenceX.getLength() )
{
if( rPolygon.SequenceX[ rIndex ].getLength() )
@@ -800,10 +771,10 @@ void AreaChart::createShapes()
//remind minimal and maximal x values for area 'grounding' points
//only for filled area
{
- double& rfMinX = (*aSeriesIter)->m_fLogicMinX;
+ double& rfMinX = pSeries->m_fLogicMinX;
if(!nIndex||fLogicX<rfMinX)
rfMinX=fLogicX;
- double& rfMaxX = (*aSeriesIter)->m_fLogicMaxX;
+ double& rfMaxX = pSeries->m_fLogicMaxX;
if(!nIndex||fLogicX>rfMaxX)
rfMaxX=fLogicX;
}
@@ -833,7 +804,7 @@ void AreaChart::createShapes()
//for area and/or line (symbols only do not need this)
if( isValidPosition(aScaledLogicPosition) )
{
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aScaledLogicPosition, pSeries->m_nPolygonIndex );
}
//create a single datapoint if point is visible
@@ -864,7 +835,7 @@ void AreaChart::createShapes()
}
}
- Symbol* pSymbolProperties = m_bSymbol ? (*aSeriesIter)->getSymbolProperties( nIndex ) : nullptr;
+ Symbol* pSymbolProperties = m_bSymbol ? pSeries->getSymbolProperties( nIndex ) : nullptr;
bool bCreateSymbol = pSymbolProperties && (pSymbolProperties->Style != SymbolStyle_NONE);
if( !bCreateSymbol && !bCreateYErrorBar &&
@@ -873,7 +844,7 @@ void AreaChart::createShapes()
//create a group shape for this point and add to the series shape:
OUString aPointCID = ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(), nIndex );
+ pSeries->getPointCID_Stub(), nIndex );
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(
createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
uno::Reference<drawing::XShape> xPointGroupShape_Shape =
@@ -917,13 +888,13 @@ void AreaChart::createShapes()
}
//create error bars
if (bCreateXErrorBar)
- createErrorBar_X( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget );
+ createErrorBar_X( aUnscaledLogicPosition, *pSeries, nIndex, m_xErrorBarTarget );
if (bCreateYErrorBar)
- createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget, nullptr );
+ createErrorBar_Y( aUnscaledLogicPosition, *pSeries, nIndex, m_xErrorBarTarget, nullptr );
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
LabelAlignment eAlignment = LABEL_ALIGN_TOP;
drawing::Position3D aScenePosition3D( aScenePosition.PositionX
@@ -970,7 +941,7 @@ void AreaChart::createShapes()
.transformSceneToScreenPosition( aScenePosition3D ) );
}
- createDataLabel( m_xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( m_xTextTarget, *pSeries, nIndex
, fLogicValueForLabeDisplay
, rLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset );
}
@@ -983,6 +954,7 @@ void AreaChart::createShapes()
}//next series in x slot (next y slot)
}//next x slot
+ ++nZ;
}//next z slot
impl_createSeriesShapes();
@@ -991,7 +963,7 @@ void AreaChart::createShapes()
//remove and delete point-group-shape if empty
if(!xSeriesGroupShape_Shapes->getCount())
{
- (*aSeriesIter)->m_xShape.set(NULL);
+ pSeries->m_xShape.set(NULL);
m_xLogicTarget->remove(xSeriesGroupShape_Shape);
}
*/
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 476dc39d36fb..41002429d900 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -450,28 +450,22 @@ void BarChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nPointIndex = nStartIndex; nPointIndex < nEndIndex; nPointIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
//sum up the values for all series in a complete z slot per attached axis
std::map< sal_Int32, double > aLogicYSumMap;
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( aXSlotIter = aZSlotIter->begin(); aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto& rXSlot : rZSlot )
{
- sal_Int32 nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
+ sal_Int32 nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
if( aLogicYSumMap.find(nAttachedAxisIndex)==aLogicYSumMap.end() )
aLogicYSumMap[nAttachedAxisIndex]=0.0;
- const sal_Int32 nSlotPoints = aXSlotIter->getPointCount();
+ const sal_Int32 nSlotPoints = rXSlot.getPointCount();
if( nPointIndex >= nSlotPoints )
continue;
double fMinimumY = 0.0, fMaximumY = 0.0;
- aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
+ rXSlot.calculateYMinAndMaxForCategory( nPointIndex
, isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
if( !::rtl::math::isNan( fMaximumY ) && fMaximumY > 0)
@@ -481,39 +475,33 @@ void BarChart::createShapes()
}
}
- aZSlotIter = m_aZSlots.begin();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ sal_Int32 nZ=1;
+ for( auto& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
//iterate through all x slots in this category
double fSlotX=0;
- for( aXSlotIter = aZSlotIter->begin(); aXSlotIter != aXSlotEnd; ++aXSlotIter, fSlotX+=1.0 )
+ for( auto& rXSlot : rZSlot )
{
sal_Int32 nAttachedAxisIndex = 0;
BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
- if( aXSlotIter != aXSlotEnd )
- {
- nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
- //2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
- pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
- if(!pPosHelper)
- pPosHelper = m_pMainPosHelper.get();
- }
+
+ nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
+ //2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
+ pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
+ if(!pPosHelper)
+ pPosHelper = m_pMainPosHelper.get();
+
PlotterBase::m_pPosHelper = pPosHelper;
//update/create information for current group
- pPosHelper->updateSeriesCount( aZSlotIter->size() );
+ pPosHelper->updateSeriesCount( rZSlot.size() );
double fLogicBaseWidth = pPosHelper->getScaledSlotWidth();
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
// get distance from base value to maximum and minimum
double fMinimumY = 0.0, fMaximumY = 0.0;
- if( nPointIndex < aXSlotIter->getPointCount())
- aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
+ if( nPointIndex < rXSlot.getPointCount())
+ rXSlot.calculateYMinAndMaxForCategory( nPointIndex
, isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
double fLogicPositiveYSum = 0.0;
@@ -547,17 +535,14 @@ void BarChart::createShapes()
}
double fBaseValue = 0.0;
- if( !pPosHelper->isPercentY() && pSeriesList->size()<=1 )
+ if( !pPosHelper->isPercentY() && rXSlot.m_aSeriesVector.size()<=1 )
fBaseValue = pPosHelper->getBaseValueY();
double fPositiveLogicYForNextSeries = fBaseValue;
double fNegativeLogicYForNextSeries = fBaseValue;
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
//iterate through all series in this x slot
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -566,7 +551,7 @@ void BarChart::createShapes()
bOnlyConnectionLinesForThisPoint = false;
if(nPointIndex==nStartIndex)//do not create a regression line for each point
- createRegressionCurvesShapes( **aSeriesIter, xRegressionCurveTarget, xRegressionCurveEquationTarget,
+ createRegressionCurvesShapes( *pSeries, xRegressionCurveTarget, xRegressionCurveEquationTarget,
m_pPosHelper->maySkipPointsInRegressionCalculation());
if( !bDrawConnectionLinesInited )
@@ -574,7 +559,7 @@ void BarChart::createShapes()
bDrawConnectionLines = pSeries->getConnectBars();
if( m_nDimension==3 )
bDrawConnectionLines = false;
- if( bDrawConnectionLines && pSeriesList->size()==1 )
+ if( bDrawConnectionLines && rXSlot.m_aSeriesVector.size()==1 )
{
//detect whether we have a stacked chart or not:
StackingDirection eDirection = pSeries->getStackingDirection();
@@ -585,10 +570,10 @@ void BarChart::createShapes()
}
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes(
- getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
+ getSeriesGroupShape(pSeries, xSeriesTarget) );
//collect data point information (logic coordinates, style ):
- double fUnscaledLogicX = (*aSeriesIter)->getXValue( nPointIndex );
+ double fUnscaledLogicX = pSeries->getXValue( nPointIndex );
fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
if(fUnscaledLogicX<pPosHelper->getLogicMinX())
continue;//point not visible
@@ -598,7 +583,7 @@ void BarChart::createShapes()
continue;//point not visible
double fLogicX = pPosHelper->getScaledSlotPos( fUnscaledLogicX, fSlotX );
- double fLogicBarHeight = (*aSeriesIter)->getYValue( nPointIndex );
+ double fLogicBarHeight = pSeries->getYValue( nPointIndex );
if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category
continue;
@@ -634,7 +619,7 @@ void BarChart::createShapes()
// uno::Reference<drawing::XShape> xPointGroupShape_Shape =
// uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY );
//as long as we do not iterate we do not need to create an additional group for each point
- uno::Reference< beans::XPropertySet > xDataPointProperties( (*aSeriesIter)->getPropertiesOfPoint( nPointIndex ) );
+ uno::Reference< beans::XPropertySet > xDataPointProperties( pSeries->getPropertiesOfPoint( nPointIndex ) );
sal_Int32 nGeometry3D = DataPointGeometry3D::CUBOID;
if(m_nDimension==3) try
{
@@ -724,9 +709,9 @@ void BarChart::createShapes()
drawing::Position3D aRightUpperPoint( fLogicX+fLogicBarWidth/2.0,fUnclippedUpperYValue,fLogicZ );
if( isValidPosition(aLeftUpperPoint) )
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aLeftUpperPoint );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aLeftUpperPoint );
if( isValidPosition(aRightUpperPoint) )
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aRightUpperPoint );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aRightUpperPoint );
}
if( bOnlyConnectionLinesForThisPoint )
@@ -813,14 +798,14 @@ void BarChart::createShapes()
//set name/classified ObjectID (CID)
ShapeFactory::setShapeName(xShape
, ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(),nPointIndex) );
+ pSeries->getPointCID_Stub(),nPointIndex) );
}
//create error bar
- createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nPointIndex, m_xLogicTarget, &fLogicX );
+ createErrorBar_Y( aUnscaledLogicPosition, *pSeries, nPointIndex, m_xLogicTarget, &fLogicX );
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nPointIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nPointIndex) )
{
double fLogicSum = aLogicYSumMap[nAttachedAxisIndex];
@@ -849,29 +834,26 @@ void BarChart::createShapes()
nOffset = 260;
}
createDataLabel(
- xTextTarget, **aSeriesIter, nPointIndex,
+ xTextTarget, *pSeries, nPointIndex,
fLogicValueForLabeDisplay, fLogicSum, aScreenPosition2D, eAlignment, nOffset);
}
}//end iteration through partial points
}//next series in x slot (next y slot)
+ fSlotX+=1.0;
}//next x slot
+ ++nZ;
}//next z slot
}//next category
if( bDrawConnectionLines )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
- if( aXSlotIter != aXSlotEnd )
+ if( rZSlot.size() )
{
- sal_Int32 nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
+ sal_Int32 nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
@@ -880,16 +862,11 @@ void BarChart::createShapes()
PlotterBase::m_pPosHelper = pPosHelper;
//iterate through all x slots in this category
- for( double fSlotX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, fSlotX+=1.0 )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
//iterate through all series in this x slot
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
drawing::PolyPolygonShape3D* pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
@@ -906,7 +883,7 @@ void BarChart::createShapes()
pPosHelper->transformScaledLogicToScene( aPoly );
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes(
- getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
+ getSeriesGroupShape(pSeries, xSeriesTarget) );
uno::Reference< drawing::XShape > xShape( m_pShapeFactory->createLine2D(
xSeriesGroupShape_Shapes, PolyToPointSequence( aPoly ) ) );
setMappedProperties( xShape, pSeries->getPropertiesOfSeries()
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index 85ff761f40d2..ced8ddb2f657 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -69,20 +69,12 @@ void BubbleChart::calculateMaximumLogicBubbleSize()
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
for( sal_Int32 nIndex = 0; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -207,31 +199,20 @@ void BubbleChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, ++nX )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
-
//iterate through all series
- for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; ++aSeriesIter, ++nSeriesIndex )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
bool bHasFillColorMapping = pSeries->hasPropertyMapping("FillColor");
bool bHasBorderColorMapping = pSeries->hasPropertyMapping("LineColor");
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
@@ -324,7 +305,7 @@ void BubbleChart::createShapes()
::chart::AbstractShapeFactory::setShapeName( xShape, "MarkHandles" );
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
LabelAlignment eAlignment = LABEL_ALIGN_TOP;
drawing::Position3D aScenePosition3D( aScenePosition.PositionX
@@ -366,7 +347,7 @@ void BubbleChart::createShapes()
sal_Int32 nOffset = 0;
if(eAlignment!=LABEL_ALIGN_CENTER)
nOffset = 100;//add some spacing //@todo maybe get more intelligent values
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fBubbleSize, fBubbleSize, aScreenPosition2D, eAlignment, nOffset );
}
}
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 079c907c4fa2..1419c9ef4968 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -137,18 +137,13 @@ void CandleStickChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nIndex = 0; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=0; aZSlotIter != aZSlotEnd; ++aZSlotIter, nZ++ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
sal_Int32 nAttachedAxisIndex = 0;
BarPositionHelper* pPosHelper = m_pMainPosHelper.get();
- if( aXSlotIter != aXSlotEnd )
+ if( rZSlot.size() )
{
- nAttachedAxisIndex = aXSlotIter->getAttachedAxisIndexForFirstSeries();
+ nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
//2ND_AXIS_IN_BARS so far one can assume to have the same plotter for each z slot
pPosHelper = dynamic_cast<BarPositionHelper*>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
if(!pPosHelper)
@@ -157,29 +152,26 @@ void CandleStickChart::createShapes()
PlotterBase::m_pPosHelper = pPosHelper;
//update/create information for current group
- pPosHelper->updateSeriesCount( aZSlotIter->size() );
+ pPosHelper->updateSeriesCount( rZSlot.size() );
+ double fSlotX=0;
//iterate through all x slots in this category
- for( double fSlotX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, fSlotX+=1.0 )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
//iterate through all series in this x slot
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* const pSeries : rXSlot.m_aSeriesVector )
{
//collect data point information (logic coordinates, style ):
- double fUnscaledX = (*aSeriesIter)->getXValue( nIndex );
+ double fUnscaledX = pSeries->getXValue( nIndex );
if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
fUnscaledX = DateHelper::RasterizeDateValue( fUnscaledX, m_aNullDate, m_nTimeResolution );
if(fUnscaledX<pPosHelper->getLogicMinX() || fUnscaledX>pPosHelper->getLogicMaxX())
continue;//point not visible
double fScaledX = pPosHelper->getScaledSlotPos( fUnscaledX, fSlotX );
- double fUnscaledY_First = (*aSeriesIter)->getY_First( nIndex );
- double fUnscaledY_Last = (*aSeriesIter)->getY_Last( nIndex );
- double fUnscaledY_Min = (*aSeriesIter)->getY_Min( nIndex );
- double fUnscaledY_Max = (*aSeriesIter)->getY_Max( nIndex );
+ double fUnscaledY_First = pSeries->getY_First( nIndex );
+ double fUnscaledY_Last = pSeries->getY_Last( nIndex );
+ double fUnscaledY_Min = pSeries->getY_Min( nIndex );
+ double fUnscaledY_Max = pSeries->getY_Max( nIndex );
bool bBlack=false;
if(fUnscaledY_Last<=fUnscaledY_First)
@@ -216,11 +208,11 @@ void CandleStickChart::createShapes()
if(bBlack)
xLossGainTarget = xLossTarget;
- uno::Reference< beans::XPropertySet > xPointProp( (*aSeriesIter)->getPropertiesOfPoint( nIndex ));
+ uno::Reference< beans::XPropertySet > xPointProp( pSeries->getPropertiesOfPoint( nIndex ));
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(nullptr);
{
- OUString aPointCID = ObjectIdentifier::createPointCID( (*aSeriesIter)->getPointCID_Stub(), nIndex );
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes( getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
+ OUString aPointCID = ObjectIdentifier::createPointCID( pSeries->getPointCID_Stub(), nIndex );
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes( getSeriesGroupShape(pSeries, xSeriesTarget) );
xPointGroupShape_Shapes = createGroupShape(xSeriesGroupShape_Shapes,aPointCID);
}
@@ -296,22 +288,23 @@ void CandleStickChart::createShapes()
}
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
if(isValidPosition(aPosMiddleFirst))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_First, 1.0, Position3DToAWTPoint(aPosMiddleFirst), LABEL_ALIGN_LEFT_BOTTOM );
if(isValidPosition(aPosMiddleLast))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_Last, 1.0, Position3DToAWTPoint(aPosMiddleLast), LABEL_ALIGN_RIGHT_TOP );
if(isValidPosition(aPosMiddleMinimum))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_Min, 1.0, Position3DToAWTPoint(aPosMiddleMinimum), LABEL_ALIGN_BOTTOM );
if(isValidPosition(aPosMiddleMaximum))
- createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( xTextTarget, *pSeries, nIndex
, fUnscaledY_Max, 1.0, Position3DToAWTPoint(aPosMiddleMaximum), LABEL_ALIGN_TOP );
}
}//next series in x slot (next y slot)
+ fSlotX+=1.0;
}//next x slot
}//next z slot
}//next category
@@ -319,7 +312,7 @@ void CandleStickChart::createShapes()
//remove and delete point-group-shape if empty
if(!xSeriesGroupShape_Shapes->getCount())
{
- (*aSeriesIter)->m_xShape.set(NULL);
+ pSeries->m_xShape.set(NULL);
m_xLogicTarget->remove(xSeriesGroupShape_Shape);
}
*/
diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx
index e9ebb0c459d6..40cbf6a641ea 100644
--- a/chart2/source/view/charttypes/NetChart.cxx
+++ b/chart2/source/view/charttypes/NetChart.cxx
@@ -243,41 +243,31 @@ void NetChart::impl_createSeriesShapes()
//the polygon shapes for each series need to be created before
//iterate through all series again to create the series shapes
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
-
- std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
- const std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
-
std::map< sal_Int32, drawing::PolyPolygonShape3D* > aPreviousSeriesPolyMap;//a PreviousSeriesPoly for each different nAttachedAxisIndex
drawing::PolyPolygonShape3D* pSeriesPoly = nullptr;
//iterate through all series
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
PlotterBase::m_pPosHelper = pPosHelper;
- pSeriesPoly = &(*aSeriesIter)->m_aPolyPolygonShape3D;
+ pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
if( m_bArea )
{
- if( !impl_createArea( *aSeriesIter, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
+ if( !impl_createArea( pSeries, pSeriesPoly, aPreviousSeriesPolyMap[nAttachedAxisIndex], pPosHelper ) )
continue;
}
if( m_bLine )
{
- if( !impl_createLine( *aSeriesIter, pSeriesPoly, pPosHelper ) )
+ if( !impl_createLine( pSeries, pSeriesPoly, pPosHelper ) )
continue;
}
aPreviousSeriesPolyMap[nAttachedAxisIndex] = pSeriesPoly;
@@ -374,25 +364,14 @@ void NetChart::createShapes()
//iterate through all x values per indices
for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
- std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
- const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
-
std::map< sal_Int32, double > aLogicYSumMap;//one for each different nAttachedAxisIndex
- for( ; aZSlotIter != aZSlotEnd; ++aZSlotIter )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
- const std::vector< VDataSeriesGroup >::iterator aXSlotEnd = aZSlotIter->end();
-
//iterate through all x slots in this category to get 100percent sum
- for( ; aXSlotIter != aXSlotEnd; ++aXSlotIter )
+ for( auto const& rXSlot : rZSlot )
{
- std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::iterator aSeriesIter = rSeriesList.begin();
- std::vector<VDataSeries*>::iterator aSeriesEnd = rSeriesList.end();
-
- for( ; aSeriesIter != aSeriesEnd; ++aSeriesIter )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
@@ -415,55 +394,46 @@ void NetChart::createShapes()
}
}
- aZSlotIter = m_aZSlots.begin();
- for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; ++aZSlotIter, ++nZ )
+ for( auto const& rZSlot : m_aZSlots )
{
- std::vector< VDataSeriesGroup >::const_iterator aXSlotIter = aZSlotIter->begin();
- std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
-
//for the area chart there should be at most one x slot (no side by side stacking available)
//attention different: xSlots are always interpreted as independent areas one behind the other: @todo this doesn't work why not???
- for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; ++aXSlotIter, ++nX )
+ for( auto const& rXSlot : rZSlot )
{
- const std::vector<VDataSeries*>& rSeriesList = aXSlotIter->m_aSeriesVector;
- std::vector<VDataSeries*>::const_iterator aSeriesIter = rSeriesList.begin();
- const std::vector<VDataSeries*>::const_iterator aSeriesEnd = rSeriesList.end();
-
std::map< sal_Int32, double > aLogicYForNextSeriesMap;//one for each different nAttachedAxisIndex
//iterate through all series
- for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; ++aSeriesIter, ++nSeriesIndex )
+ for( VDataSeries* pSeries : rXSlot.m_aSeriesVector )
{
- VDataSeries* pSeries( *aSeriesIter );
if(!pSeries)
continue;
/* #i70133# ignore points outside of series length in standard area
charts. Stacked area charts will use missing points as zeros. In
standard charts, pSeriesList contains only one series. */
- if( m_bArea && (rSeriesList.size() == 1) && (nIndex >= (*aSeriesIter)->getTotalPointCount()) )
+ if( m_bArea && (rXSlot.m_aSeriesVector.size() == 1) && (nIndex >= pSeries->getTotalPointCount()) )
continue;
- uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(*aSeriesIter, m_xSeriesTarget);
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShapeFrontChild(pSeries, m_xSeriesTarget);
- sal_Int32 nAttachedAxisIndex = (*aSeriesIter)->getAttachedAxisIndex();
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
PlottingPositionHelper* pPosHelper = &(getPlottingPositionHelper( nAttachedAxisIndex ));
if(!pPosHelper)
pPosHelper = m_pMainPosHelper.get();
PlotterBase::m_pPosHelper = pPosHelper;
- (*aSeriesIter)->m_fLogicZPos = fLogicZ;
+ pSeries->m_fLogicZPos = fLogicZ;
//collect data point information (logic coordinates, style ):
- double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ double fLogicX = pSeries->getXValue(nIndex);
if (bDateCategory)
fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution );
- double fLogicY = (*aSeriesIter)->getYValue(nIndex);
+ double fLogicY = pSeries->getYValue(nIndex);
if( m_bArea && ( ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY) ) )
{
- if( (*aSeriesIter)->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
+ if( pSeries->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
{
- if( rSeriesList.size() == 1 || nSeriesIndex == 0 )
+ if( rXSlot.m_aSeriesVector.size() == 1 || pSeries == rXSlot.m_aSeriesVector.front() )
{
fLogicY = pPosHelper->getLogicMinY();
if( !pPosHelper->isMathematicalOrientationY() )
@@ -483,10 +453,10 @@ void NetChart::createShapes()
|| ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY)
|| ::rtl::math::isNan(fLogicZ) || ::rtl::math::isInf(fLogicZ) )
{
- if( (*aSeriesIter)->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
+ if( pSeries->getMissingValueTreatment() == css::chart::MissingValueTreatment::LEAVE_GAP )
{
- drawing::PolyPolygonShape3D& rPolygon = (*aSeriesIter)->m_aPolyPolygonShape3D;
- sal_Int32& rIndex = (*aSeriesIter)->m_nPolygonIndex;
+ drawing::PolyPolygonShape3D& rPolygon = pSeries->m_aPolyPolygonShape3D;
+ sal_Int32& rIndex = pSeries->m_nPolygonIndex;
if( 0<= rIndex && rIndex < rPolygon.SequenceX.getLength() )
{
if( rPolygon.SequenceX[ rIndex ].getLength() )
@@ -509,10 +479,10 @@ void NetChart::createShapes()
//remind minimal and maximal x values for area 'grounding' points
//only for filled area
{
- double& rfMinX = (*aSeriesIter)->m_fLogicMinX;
+ double& rfMinX = pSeries->m_fLogicMinX;
if(!nIndex||fLogicX<rfMinX)
rfMinX=fLogicX;
- double& rfMaxX = (*aSeriesIter)->m_fLogicMaxX;
+ double& rfMaxX = pSeries->m_fLogicMaxX;
if(!nIndex||fLogicX>rfMaxX)
rfMaxX=fLogicX;
}
@@ -542,7 +512,7 @@ void NetChart::createShapes()
//for area and/or line (symbols only do not need this)
if( isValidPosition(aScaledLogicPosition) )
{
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aScaledLogicPosition, pSeries->m_nPolygonIndex );
//prepare clipping for filled net charts
if( !bIsVisible && m_bArea )
@@ -551,8 +521,8 @@ void NetChart::createShapes()
pPosHelper->clipScaledLogicValues( nullptr, &aClippedPos.PositionY, nullptr );
if( pPosHelper->isLogicVisible( aClippedPos.PositionX, aClippedPos.PositionY, aClippedPos.PositionZ ) )
{
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aClippedPos, (*aSeriesIter)->m_nPolygonIndex );
- AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aClippedPos, pSeries->m_nPolygonIndex );
+ AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aScaledLogicPosition, pSeries->m_nPolygonIndex );
}
}
}
@@ -562,7 +532,7 @@ void NetChart::createShapes()
if( !bIsVisible )
continue;
- Symbol* pSymbolProperties = (*aSeriesIter)->getSymbolProperties( nIndex );
+ Symbol* pSymbolProperties = pSeries->getSymbolProperties( nIndex );
bool bCreateSymbol = pSymbolProperties && (pSymbolProperties->Style != SymbolStyle_NONE);
if( !bCreateSymbol && !pSeries->getDataPointLabelIfLabel(nIndex) )
@@ -570,7 +540,7 @@ void NetChart::createShapes()
//create a group shape for this point and add to the series shape:
OUString aPointCID = ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(), nIndex );
+ pSeries->getPointCID_Stub(), nIndex );
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(
createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
uno::Reference<drawing::XShape> xPointGroupShape_Shape =
@@ -611,7 +581,7 @@ void NetChart::createShapes()
}
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ if( pSeries->getDataPointLabelIfLabel(nIndex) )
{
LabelAlignment eAlignment = LABEL_ALIGN_TOP;
drawing::Position3D aScenePosition3D( aScenePosition.PositionX
@@ -669,7 +639,7 @@ void NetChart::createShapes()
.transformSceneToScreenPosition( aScenePosition3D ) );
}
- createDataLabel( m_xTextTarget, **aSeriesIter, nIndex
+ createDataLabel( m_xTextTarget, *pSeries, nIndex
, fLogicValueForLabeDisplay
, aLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset );
}