[Libreoffice-commits] core.git: chart2/source
Julien Nabet
serval2412 at yahoo.fr
Sat Mar 3 18:21:15 UTC 2018
chart2/source/controller/accessibility/AccessibleBase.cxx | 37 +++-----
chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 5 -
chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 14 +--
chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx | 12 --
chart2/source/controller/dialogs/ChartTypeDialogController.cxx | 22 +---
chart2/source/controller/dialogs/DataBrowser.cxx | 35 +++----
chart2/source/controller/dialogs/DataBrowserModel.cxx | 26 ++---
chart2/source/controller/dialogs/tp_ChartType.cxx | 26 ++---
chart2/source/controller/dialogs/tp_DataSource.cxx | 16 +--
chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx | 14 +--
chart2/source/controller/main/ControllerCommandDispatch.cxx | 7 -
chart2/source/controller/main/ElementSelector.cxx | 15 +--
chart2/source/controller/main/FeatureCommandDispatchBase.cxx | 7 -
chart2/source/controller/main/ObjectHierarchy.cxx | 20 ++--
chart2/source/model/main/Axis.cxx | 9 -
chart2/source/model/main/DataSeries.cxx | 7 -
chart2/source/model/template/AreaChartTypeTemplate.cxx | 7 -
chart2/source/model/template/BarChartTypeTemplate.cxx | 5 -
chart2/source/model/template/DataInterpreter.cxx | 8 -
chart2/source/model/template/LineChartTypeTemplate.cxx | 5 -
chart2/source/model/template/NetChartTypeTemplate.cxx | 5 -
chart2/source/model/template/PieChartTypeTemplate.cxx | 5 -
chart2/source/model/template/ScatterChartTypeTemplate.cxx | 5 -
chart2/source/model/template/StockChartTypeTemplate.cxx | 5 -
chart2/source/model/template/XYDataInterpreter.cxx | 12 +-
chart2/source/tools/AxisHelper.cxx | 25 ++---
chart2/source/tools/DataSeriesHelper.cxx | 6 -
chart2/source/tools/DataSourceHelper.cxx | 17 +--
chart2/source/tools/DiagramHelper.cxx | 23 +----
chart2/source/tools/ExplicitCategoriesProvider.cxx | 46 +++-------
30 files changed, 188 insertions(+), 258 deletions(-)
New commits:
commit ba7191ed0d4da2f5a2ebd2ef40387b26145860f1
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat Mar 3 12:54:07 2018 +0100
Use for-range loops in chart2 (part1)
Change-Id: I9310a6dc79d47f9058df8a3b463667389af1b2cb
Reviewed-on: https://gerrit.libreoffice.org/50672
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 768a09e52e88..8c26f4629229 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -157,15 +157,14 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
ChildListVectorType aLocalChildList( m_aChildList );
aGuard.clear();
- ChildListVectorType::iterator aEndIter = aLocalChildList.end();
- for( ChildListVectorType::iterator aIter = aLocalChildList.begin() ;
- ( aIter != aEndIter ) && ( ! bStop ) ;
- ++aIter )
+ for (auto const& localChild : aLocalChildList)
{
// Note: at this place we must be sure to have an AccessibleBase
// object in the UNO reference to XAccessible !
bStop = (*static_cast< AccessibleBase * >
- ( (*aIter).get() )).NotifyEvent( eEventType, rId );
+ ( localChild.get() )).NotifyEvent( eEventType, rId );
+ if (bStop)
+ break;
}
return bStop;
}
@@ -231,23 +230,22 @@ bool AccessibleBase::ImplUpdateChildren()
aModelChildren.begin(), aModelChildren.end(),
std::back_inserter( aChildrenToRemove ));
- std::vector< ObjectIdentifier >::const_iterator aIt( aChildrenToRemove.begin());
- for( ; aIt != aChildrenToRemove.end(); ++aIt )
+ for (auto const& childToRemove : aChildrenToRemove)
{
- RemoveChildByOId( *aIt );
+ RemoveChildByOId(childToRemove);
}
AccessibleElementInfo aAccInfo( GetInfo());
aAccInfo.m_pParent = this;
- for( aIt = aChildrenToAdd.begin(); aIt != aChildrenToAdd.end(); ++aIt )
+ for (auto const& childToAdd : aChildrenToAdd)
{
- aAccInfo.m_aOID = *aIt;
- if ( aIt->isAutoGeneratedObject() )
+ aAccInfo.m_aOID = childToAdd;
+ if ( childToAdd.isAutoGeneratedObject() )
{
AddChild( ChartElementFactory::CreateChartElement( aAccInfo ) );
}
- else if ( aIt->isAdditionalShape() )
+ else if ( childToAdd.isAdditionalShape() )
{
AddChild( new AccessibleChartShape( aAccInfo ) );
}
@@ -395,14 +393,12 @@ void AccessibleBase::KillAllChildren()
// and notify listeners
Reference< lang::XComponent > xComp;
Any aEmpty, aOld;
- ChildListVectorType::const_iterator aEndIter = aLocalChildList.end();
- for( ChildListVectorType::const_iterator aIter = aLocalChildList.begin();
- aIter != aEndIter; ++aIter )
+ for (auto const& localChild : aLocalChildList)
{
- aOld <<= (*aIter);
+ aOld <<= localChild;
BroadcastAccEvent( AccessibleEventId::CHILD, aEmpty, aOld );
- xComp.set( *aIter, UNO_QUERY );
+ xComp.set(localChild, UNO_QUERY);
if( xComp.is())
xComp->dispose();
}
@@ -619,17 +615,16 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw
aGuard.clear();
Reference< XAccessibleComponent > aComp;
- for( ChildListVectorType::const_iterator aIter = aLocalChildList.begin();
- aIter != aLocalChildList.end(); ++aIter )
+ for (auto const& localChild : aLocalChildList)
{
- aComp.set( *aIter, UNO_QUERY );
+ aComp.set(localChild, UNO_QUERY);
if( aComp.is())
{
aRect = aComp->getBounds();
if( ( aRect.X <= aPoint.X && aPoint.X <= (aRect.X + aRect.Width) ) &&
( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height)))
{
- aResult = (*aIter);
+ aResult = localChild;
break;
}
}
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index cd62dbfe61dd..21c965854fba 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -997,9 +997,8 @@ Reference< drawing::XShapes > ChartDocumentWrapper::getAdditionalShapes() const
OSL_ENSURE( xFoundShapes.is(), "Couldn't create a shape collection!" );
if( xFoundShapes.is())
{
- std::vector< uno::Reference< drawing::XShape > >::iterator aIter;
- for( aIter = aShapeVector.begin(); aIter != aShapeVector.end(); ++aIter )
- xFoundShapes->add( *aIter );
+ for (auto const& shape : aShapeVector)
+ xFoundShapes->add(shape);
}
}
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 7351ca30fcda..7f6048e68ce5 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -1600,12 +1600,10 @@ void WrappedAttributedDataPointsProperty::setPropertyValue( const Any& rOuterVal
{
std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVector.begin();
sal_Int32 i = 0;
- for( ; aIt != aSeriesVector.end(); ++aIt, ++i )
+ for (auto const& series : aSeriesVector)
{
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
if( xProp.is())
{
uno::Any aVal;
@@ -1619,6 +1617,7 @@ void WrappedAttributedDataPointsProperty::setPropertyValue( const Any& rOuterVal
}
xProp->setPropertyValue( "AttributedDataPoints", aVal );
}
+ ++i;
}
}
}
@@ -1635,12 +1634,10 @@ Any WrappedAttributedDataPointsProperty::getPropertyValue( const Reference< bean
uno::Sequence< uno::Sequence< sal_Int32 > > aResult( aSeriesVector.size() );
- std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVector.begin();
sal_Int32 i = 0;
- for( ; aIt != aSeriesVector.end(); ++aIt, ++i )
+ for (auto const& series : aSeriesVector)
{
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
if( xProp.is())
{
uno::Any aVal(
@@ -1649,6 +1646,7 @@ Any WrappedAttributedDataPointsProperty::getPropertyValue( const Reference< bean
if( aVal >>= aSeq )
aResult[ i ] = aSeq;
}
+ ++i;
}
m_aOuterValue <<= aResult;
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
index 63d5c90b6a16..d3eefe7e4adb 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
@@ -67,11 +67,9 @@ public:
{
std::vector< css::uno::Reference< css::chart2::XDataSeries > > aSeriesVector(
::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getChart2Diagram() ) );
- std::vector< css::uno::Reference< css::chart2::XDataSeries > >::const_iterator aIter =
- aSeriesVector.begin();
- for( ; aIter != aSeriesVector.end(); ++aIter )
+ for (auto const& series : aSeriesVector)
{
- PROPERTYTYPE aCurValue = getValueFromSeries( css::uno::Reference< css::beans::XPropertySet >::query( *aIter ) );
+ PROPERTYTYPE aCurValue = getValueFromSeries( css::uno::Reference< css::beans::XPropertySet >::query(series) );
if( !bHasDetectableInnerValue )
rValue = aCurValue;
else
@@ -96,11 +94,9 @@ public:
{
std::vector< css::uno::Reference< css::chart2::XDataSeries > > aSeriesVector(
::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getChart2Diagram() ) );
- std::vector< css::uno::Reference< css::chart2::XDataSeries > >::const_iterator aIter =
- aSeriesVector.begin();
- for( ; aIter != aSeriesVector.end(); ++aIter )
+ for (auto const& series : aSeriesVector)
{
- css::uno::Reference< css::beans::XPropertySet > xSeriesPropertySet( *aIter, css::uno::UNO_QUERY );
+ css::uno::Reference< css::beans::XPropertySet > xSeriesPropertySet(series, css::uno::UNO_QUERY);
if( xSeriesPropertySet.is() )
{
setValueToSeries( xSeriesPropertySet, aNewValue );
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 5e950e9e9b32..c57536c59800 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -199,13 +199,11 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
rParameter.eStackMode = GlobalStackMode_NONE;
const tTemplateServiceChartTypeParameterMap& rMap = getTemplateMap();
- tTemplateServiceChartTypeParameterMap::const_iterator aIter = rMap.begin();
- const tTemplateServiceChartTypeParameterMap::const_iterator aEnd = rMap.end();
for( sal_Int32 nMatchPrecision=0; nMatchPrecision<7 && !bFoundSomeMatch; nMatchPrecision++ )
{
- for( aIter = rMap.begin(); aIter != aEnd; ++aIter )
+ for (auto const& elem : rMap)
{
- if( rParameter.mapsToSimilarService( (*aIter).second, nMatchPrecision ) )
+ if( rParameter.mapsToSimilarService( elem.second, nMatchPrecision ) )
{
//remind some values
ThreeDLookScheme aScheme = rParameter.eThreeDLookScheme;
@@ -216,7 +214,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
bool bSortByXValues = rParameter.bSortByXValues;
bool bRoundedEdge = rParameter.mbRoundedEdge;
- rParameter = (*aIter).second;
+ rParameter = elem.second;
//some values should not be changed with charttype
rParameter.eThreeDLookScheme = aScheme;
@@ -248,21 +246,19 @@ OUString ChartTypeDialogController::getServiceNameForParameter( const ChartTypeP
if(!aParameter.b3DLook && aParameter.eStackMode==GlobalStackMode_STACK_Z)
aParameter.eStackMode = GlobalStackMode_NONE;
const tTemplateServiceChartTypeParameterMap& rMap = getTemplateMap();
- tTemplateServiceChartTypeParameterMap::const_iterator aIter = rMap.begin();
- const tTemplateServiceChartTypeParameterMap::const_iterator aEnd = rMap.end();
- for( ; aIter != aEnd; ++aIter )
+ for (auto const& elem : rMap)
{
- if( aParameter.mapsToSameService( (*aIter).second ) )
- return (*aIter).first;
+ if( aParameter.mapsToSameService(elem.second) )
+ return elem.first;
}
OSL_FAIL( "ChartType not implemented yet - use fallback to similar type" );
for( sal_Int32 nMatchPrecision=1; nMatchPrecision<8; nMatchPrecision++ )
{
- for( aIter = rMap.begin(); aIter != aEnd; ++aIter )
+ for (auto const& elem : rMap)
{
- if( aParameter.mapsToSimilarService( (*aIter).second, nMatchPrecision ) )
- return (*aIter).first;
+ if( aParameter.mapsToSimilarService(elem.second, nMatchPrecision) )
+ return elem.first;
}
}
return OUString();
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 2864c840a353..547b453d3b94 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -410,14 +410,15 @@ bool lcl_SeriesHeaderHasFocus(
sal_Int32 * pOutIndex = nullptr )
{
sal_Int32 nIndex = 0;
- for( auto aIt = rSeriesHeader.begin(); aIt != rSeriesHeader.end(); ++aIt, ++nIndex )
+ for (auto const& elem : rSeriesHeader)
{
- if( (*aIt)->HasFocus())
+ if(elem->HasFocus())
{
if( pOutIndex )
*pOutIndex = nIndex;
return true;
}
+ ++nIndex;
}
return false;
}
@@ -604,25 +605,24 @@ void DataBrowser::RenewTable()
Link<Control&,void> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
Link<impl::SeriesHeaderEdit*,void> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
- for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
- aIt != aHeaders.end(); ++aIt )
+ for (auto const& elemHeader : aHeaders)
{
std::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( pWin, pColorWin ));
- Reference< beans::XPropertySet > xSeriesProp( aIt->m_xDataSeries, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xSeriesProp( elemHeader.m_xDataSeries, uno::UNO_QUERY );
sal_Int32 nColor = 0;
// @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc.
if( xSeriesProp.is() &&
( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
spHeader->SetColor( Color( nColor ));
- spHeader->SetChartType( aIt->m_xChartType, aIt->m_bSwapXAndYAxis );
+ spHeader->SetChartType( elemHeader.m_xChartType, elemHeader.m_bSwapXAndYAxis );
spHeader->SetSeriesName(
DataSeriesHelper::getDataSeriesLabel(
- aIt->m_xDataSeries,
- (aIt->m_xChartType.is() ?
- aIt->m_xChartType->getRoleOfSequenceForSeriesLabel() :
+ elemHeader.m_xDataSeries,
+ (elemHeader.m_xChartType.is() ?
+ elemHeader.m_xChartType->getRoleOfSequenceForSeriesLabel() :
OUString("values-y"))));
// index is 1-based, as 0 is for the column that contains the row-numbers
- spHeader->SetRange( aIt->m_nStartColumn + 1, aIt->m_nEndColumn + 1 );
+ spHeader->SetRange( elemHeader.m_nStartColumn + 1, elemHeader.m_nEndColumn + 1 );
spHeader->SetGetFocusHdl( aFocusLink );
spHeader->SetEditChangedHdl( aSeriesHeaderChangedLink );
m_aSeriesHeaders.push_back( spHeader );
@@ -1254,23 +1254,22 @@ void DataBrowser::RenewSeriesHeaders()
Link<Control&,void> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
Link<impl::SeriesHeaderEdit*,void> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
- for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
- aIt != aHeaders.end(); ++aIt )
+ for (auto const& elemHeader : aHeaders)
{
std::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( pWin, pColorWin ));
- Reference< beans::XPropertySet > xSeriesProp( aIt->m_xDataSeries, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xSeriesProp(elemHeader.m_xDataSeries, uno::UNO_QUERY);
sal_Int32 nColor = 0;
if( xSeriesProp.is() &&
( xSeriesProp->getPropertyValue( "Color" ) >>= nColor ))
spHeader->SetColor( Color( nColor ));
- spHeader->SetChartType( aIt->m_xChartType, aIt->m_bSwapXAndYAxis );
+ spHeader->SetChartType( elemHeader.m_xChartType, elemHeader.m_bSwapXAndYAxis );
spHeader->SetSeriesName(
DataSeriesHelper::getDataSeriesLabel(
- aIt->m_xDataSeries,
- (aIt->m_xChartType.is() ?
- aIt->m_xChartType->getRoleOfSequenceForSeriesLabel() :
+ elemHeader.m_xDataSeries,
+ (elemHeader.m_xChartType.is() ?
+ elemHeader.m_xChartType->getRoleOfSequenceForSeriesLabel() :
OUString( "values-y"))));
- spHeader->SetRange( aIt->m_nStartColumn + 1, aIt->m_nEndColumn + 1 );
+ spHeader->SetRange( elemHeader.m_nStartColumn + 1, elemHeader.m_nEndColumn + 1 );
spHeader->SetGetFocusHdl( aFocusLink );
spHeader->SetEditChangedHdl( aSeriesHeaderChangedLink );
m_aSeriesHeaders.push_back( spHeader );
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index 4a7b0ab6a9fe..1b570be90e49 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -556,11 +556,10 @@ void DataBrowserModel::removeDataPointForAllSeries( sal_Int32 nAtIndex )
DataBrowserModel::tDataHeader DataBrowserModel::getHeaderForSeries(
const Reference< chart2::XDataSeries > & xSeries ) const
{
- for( tDataHeaderVector::const_iterator aIt( m_aHeaders.begin());
- aIt != m_aHeaders.end(); ++aIt )
+ for (auto const& elemHeader : m_aHeaders)
{
- if( aIt->m_xDataSeries == xSeries )
- return (*aIt);
+ if( elemHeader.m_xDataSeries == xSeries )
+ return elemHeader;
}
return tDataHeader();
}
@@ -712,13 +711,12 @@ sal_Int32 DataBrowserModel::getColumnCount() const
sal_Int32 DataBrowserModel::getMaxRowCount() const
{
sal_Int32 nResult = 0;
- tDataColumnVector::const_iterator aIt( m_aColumns.begin());
- for( ; aIt != m_aColumns.end(); ++aIt )
+ for (auto const& column : m_aColumns)
{
- if( aIt->m_xLabeledDataSequence.is())
+ if( column.m_xLabeledDataSequence.is())
{
Reference< chart2::data::XDataSequence > xSeq(
- aIt->m_xLabeledDataSequence->getValues());
+ column.m_xLabeledDataSequence->getValues());
if( !xSeq.is())
continue;
sal_Int32 nLength( xSeq->getData().getLength());
@@ -753,10 +751,9 @@ bool DataBrowserModel::isCategoriesColumn( sal_Int32 nColumnIndex ) const
sal_Int32 DataBrowserModel::getCategoryColumnCount()
{
sal_Int32 nLastTextColumnIndex = -1;
- tDataColumnVector::const_iterator aIt = m_aColumns.begin();
- for( ; aIt != m_aColumns.end(); ++aIt )
+ for (auto const& column : m_aColumns)
{
- if( !aIt->m_xDataSeries.is() )
+ if( !column.m_xDataSeries.is() )
nLastTextColumnIndex++;
else
break;
@@ -830,12 +827,11 @@ void DataBrowserModel::updateFromModel()
Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries());
lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
- for( lcl_tSharedSeqVec::const_iterator aIt( aSharedSequences.begin());
- aIt != aSharedSequences.end(); ++aIt )
+ for (auto const& sharedSequence : aSharedSequences)
{
tDataColumn aSharedSequence;
- aSharedSequence.m_xLabeledDataSequence = *aIt;
- aSharedSequence.m_aUIRoleName = lcl_getUIRoleName( *aIt );
+ aSharedSequence.m_xLabeledDataSequence = sharedSequence;
+ aSharedSequence.m_aUIRoleName = lcl_getUIRoleName(sharedSequence);
aSharedSequence.m_eCellType = NUMBER;
// as the sequences are shared it should be ok to take the first series
// @todo: dimension index 0 for x-values used here. This is just a guess.
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index f1d0df70a1de..28c5b015a27f 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -736,12 +736,10 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent
if ( aOpts.IsExperimentalMode() )
m_aChartTypeDialogControllerList.push_back(new GL3DBarChartDialogController());
- std::vector< ChartTypeDialogController* >::const_iterator aIter = m_aChartTypeDialogControllerList.begin();
- const std::vector< ChartTypeDialogController* >::const_iterator aEnd = m_aChartTypeDialogControllerList.end();
- for( ; aIter != aEnd; ++aIter )
+ for (auto const& elem : m_aChartTypeDialogControllerList)
{
- m_pMainTypeList->InsertEntry( (*aIter)->getName(), (*aIter)->getImage() );
- (*aIter)->setChangeListener( this );
+ m_pMainTypeList->InsertEntry( elem->getName(), elem->getImage() );
+ elem->setChangeListener( this );
}
m_pDim3DLookResourceGroup->setChangeListener( this );
@@ -760,11 +758,9 @@ ChartTypeTabPage::~ChartTypeTabPage()
void ChartTypeTabPage::dispose()
{
//delete all dialog controller
- std::vector< ChartTypeDialogController* >::const_iterator aIter = m_aChartTypeDialogControllerList.begin();
- const std::vector< ChartTypeDialogController* >::const_iterator aEnd = m_aChartTypeDialogControllerList.end();
- for( ; aIter != aEnd; ++aIter )
+ for (auto const& elem : m_aChartTypeDialogControllerList)
{
- delete *aIter;
+ delete elem;
}
m_aChartTypeDialogControllerList.clear();
@@ -956,18 +952,17 @@ void ChartTypeTabPage::initializePage()
bool bFound = false;
- std::vector< ChartTypeDialogController* >::iterator aIter = m_aChartTypeDialogControllerList.begin();
- const std::vector< ChartTypeDialogController* >::const_iterator aEnd = m_aChartTypeDialogControllerList.end();
- for( sal_uInt16 nM=0; aIter != aEnd; ++aIter, ++nM )
+ sal_uInt16 nM=0;
+ for (auto const& elem : m_aChartTypeDialogControllerList)
{
- if( (*aIter)->isSubType(aServiceName) )
+ if( elem->isSubType(aServiceName) )
{
bFound = true;
m_pMainTypeList->SelectEntryPos( nM );
- showAllControls( **aIter );
+ showAllControls(*elem);
uno::Reference< beans::XPropertySet > xTemplateProps( aTemplate.first, uno::UNO_QUERY );
- ChartTypeParameter aParameter = (*aIter)->getChartTypeParameterForService( aServiceName, xTemplateProps );
+ ChartTypeParameter aParameter = elem->getChartTypeParameterForService( aServiceName, xTemplateProps );
m_pCurrentMainType = getSelectedMainType();
//set ThreeDLookScheme
@@ -990,6 +985,7 @@ void ChartTypeTabPage::initializePage()
m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
break;
}
+ ++nM;
}
if( !bFound )
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 2e6db479409e..25b53d9b6ffc 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -405,10 +405,9 @@ void DataSourceTabPage::fillSeriesListBox()
m_rDialogModel.getAllDataSeriesWithLabel() );
sal_Int32 nUnnamedSeriesIndex = 1;
- for( std::vector< DialogModel::tSeriesWithChartTypeByName >::const_iterator aIt = aSeries.begin();
- aIt != aSeries.end(); ++aIt )
+ for (auto const& series : aSeries)
{
- OUString aLabel( (*aIt).first );
+ OUString aLabel(series.first);
if( aLabel.isEmpty())
{
if( nUnnamedSeriesIndex > 1 )
@@ -432,9 +431,9 @@ void DataSourceTabPage::fillSeriesListBox()
m_pLB_SERIES->InsertEntry( aLabel ));
if( pEntry )
{
- pEntry->m_xDataSeries.set( (*aIt).second.first );
- pEntry->m_xChartType.set( (*aIt).second.second );
- if( bHasSelectedEntry && ((*aIt).second.first == xSelected))
+ pEntry->m_xDataSeries.set(series.second.first);
+ pEntry->m_xChartType.set(series.second.second);
+ if( bHasSelectedEntry && (series.second.first == xSelected))
pSelectedEntry = pEntry;
}
}
@@ -468,10 +467,9 @@ void DataSourceTabPage::fillRoleListBox()
m_pLB_ROLE->Clear();
m_pLB_ROLE->RemoveSelection();
- for( DialogModel::tRolesWithRanges::const_iterator aIt( aRoles.begin());
- aIt != aRoles.end(); ++ aIt )
+ for (auto const& elemRole : aRoles)
{
- m_pLB_ROLE->InsertEntry( lcl_GetRoleLBEntry( aIt->first, aIt->second ));
+ m_pLB_ROLE->InsertEntry( lcl_GetRoleLBEntry(elemRole.first, elemRole.second));
}
// series may contain no roles, check listbox size before selecting entries
diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
index 29019f2c13ff..b9e75ea51111 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
@@ -106,19 +106,18 @@ AllDataLabelItemConverter::AllDataLabelItemConverter(
std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
::chart::ChartModelHelper::getDataSeries( xChartModel ));
- std::vector< uno::Reference< chart2::XDataSeries > >::const_iterator aIt;
- for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt )
+ for (auto const& series : aSeriesList)
{
- uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
+ uno::Reference< beans::XPropertySet > xObjectProperties(series, uno::UNO_QUERY);
uno::Reference< uno::XComponentContext> xContext(nullptr);//do not need Context for label properties
- sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, *aIt, -1/*nPointIndex*/, ChartModelHelper::findDiagram( xChartModel ) );
+ sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, series, -1/*nPointIndex*/, ChartModelHelper::findDiagram( xChartModel ) );
sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
m_aConverters.push_back(
new ::chart::wrapper::DataPointItemConverter(
- xChartModel, xContext, xObjectProperties, *aIt, rItemPool, rDrawModel,
+ xChartModel, xContext, xObjectProperties, series, rItemPool, rDrawModel,
xNamedPropertyContainerFactory, GraphicObjectType::FilledDataPoint,
nullptr, true, false, 0, true, nNumberFormat, nPercentNumberFormat));
}
@@ -171,10 +170,9 @@ AllSeriesStatisticsConverter::AllSeriesStatisticsConverter(
std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
::chart::ChartModelHelper::getDataSeries( xChartModel ));
- std::vector< uno::Reference< chart2::XDataSeries > >::const_iterator aIt;
- for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt )
+ for (auto const& series : aSeriesList)
{
- uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
+ uno::Reference< beans::XPropertySet > xObjectProperties(series, uno::UNO_QUERY);
m_aConverters.push_back( new ::chart::wrapper::StatisticsItemConverter(
xChartModel, xObjectProperties, rItemPool ));
}
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 537c54c77b58..2e655741eac5 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -745,9 +745,10 @@ void ControllerCommandDispatch::fireStatusEvent(
}
if( rURL.isEmpty() )
- for( std::map< OUString, bool >::const_iterator aIt( m_aCommandAvailability.begin());
- aIt != m_aCommandAvailability.end(); ++aIt )
- fireStatusEventForURLImpl( aIt->first, xSingleListener );
+ {
+ for (auto const& elem : m_aCommandAvailability)
+ fireStatusEventForURLImpl( elem.first, xSingleListener );
+ }
else if( !bIsChartSelectorURL )
fireStatusEventForURLImpl( rURL, xSingleListener );
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index e532fa415033..a7ce1843d8f1 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -59,10 +59,9 @@ void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdent
, const sal_Int32 nHierarchyDepth, const Reference< chart2::XChartDocument >& xChartDoc )
{
ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) );
- ObjectHierarchy::tChildContainer::const_iterator aIt( aChildren.begin());
- while( aIt != aChildren.end() )
+ for (auto const& child : aChildren)
{
- ObjectIdentifier aOID = *aIt;
+ ObjectIdentifier aOID = child;
OUString aCID = aOID.getObjectCID();
ListBoxEntryData aEntry;
aEntry.OID = aOID;
@@ -70,7 +69,6 @@ void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdent
aEntry.nHierarchyDepth = nHierarchyDepth;
rEntries.push_back(aEntry);
lcl_addObjectsToList( rHierarchy, aOID, rEntries, nHierarchyDepth+1, xChartDoc );
- ++aIt;
}
}
@@ -144,15 +142,16 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
}
sal_uInt16 nEntryPosToSelect = 0; bool bSelectionFound = false;
- aIt = m_aEntries.begin();
- for( sal_uInt16 nN=0; aIt != m_aEntries.end(); ++aIt, ++nN )
+ sal_uInt16 nN=0;
+ for (auto const& entry : m_aEntries)
{
- InsertEntry( aIt->UIName );
- if ( !bSelectionFound && aSelectedOID == aIt->OID )
+ InsertEntry(entry.UIName);
+ if ( !bSelectionFound && aSelectedOID == entry.OID )
{
nEntryPosToSelect = nN;
bSelectionFound = true;
}
+ ++nN;
}
if( bSelectionFound )
diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
index b5171cb3d67b..95d77a357803 100644
--- a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
+++ b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
@@ -54,11 +54,10 @@ void FeatureCommandDispatchBase::fireStatusEvent( const OUString& rURL,
{
if ( rURL.isEmpty() )
{
- SupportedFeatures::const_iterator aEnd( m_aSupportedFeatures.end() );
- for ( SupportedFeatures::const_iterator aIter( m_aSupportedFeatures.begin() ); aIter != aEnd; ++aIter )
+ for (auto const& elem : m_aSupportedFeatures)
{
- FeatureState aFeatureState( getState( aIter->first ) );
- fireStatusEventForURL( aIter->first, aFeatureState.aState, aFeatureState.bEnabled, xSingleListener );
+ FeatureState aFeatureState( getState(elem.first) );
+ fireStatusEventForURL( elem.first, aFeatureState.aState, aFeatureState.bEnabled, xSingleListener );
}
}
else
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index d11210666caf..062792b81aba 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -558,13 +558,12 @@ ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const ObjectI
{
if ( rNode.isValid() && !ObjectHierarchy::isRootNode( rNode ) )
{
- for( tChildMap::const_iterator aIt( m_aChildMap.begin());
- aIt != m_aChildMap.end(); ++aIt )
+ for (auto const& child : m_aChildMap)
{
ObjectHierarchy::tChildContainer::const_iterator aElemIt(
- std::find( aIt->second.begin(), aIt->second.end(), rNode ));
- if( aElemIt != aIt->second.end())
- return aIt->second;
+ std::find( child.second.begin(), child.second.end(), rNode ));
+ if( aElemIt != child.second.end())
+ return child.second;
}
}
return ObjectHierarchy::tChildContainer();
@@ -582,10 +581,10 @@ ObjectIdentifier ImplObjectHierarchy::getParentImpl(
if( aIt != aChildren.end())
return rParentOID;
- for( aIt = aChildren.begin(); aIt != aChildren.end(); ++aIt )
+ for (auto const& child : aChildren)
{
// recursion
- ObjectIdentifier aTempParent( getParentImpl( *aIt, rOID ));
+ ObjectIdentifier aTempParent( getParentImpl( child, rOID ));
if ( aTempParent.isValid() )
{
// exit on success
@@ -665,11 +664,12 @@ sal_Int32 ObjectHierarchy::getIndexInParent(
{
ObjectIdentifier aParentOID( m_apImpl->getParent( rNode ));
tChildContainer aChildren( m_apImpl->getChildren( aParentOID ) );
- tChildContainer::const_iterator aIt( aChildren.begin() );
- for( sal_Int32 nIndex = 0; aIt != aChildren.end(); ++nIndex, ++aIt )
+ sal_Int32 nIndex = 0;
+ for (auto const& child : aChildren)
{
- if ( *aIt == rNode )
+ if ( child == rNode )
return nIndex;
+ ++nIndex;
}
return -1;
}
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 639c347582da..49340ee8d9b8 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -426,11 +426,10 @@ void Axis::AllocateSubGrids()
}
}
//don't keep the mutex locked while calling out
- std::vector< Reference< beans::XPropertySet > >::iterator aBroadcaster = aOldBroadcasters.begin();
- for( ;aBroadcaster != aOldBroadcasters.end(); ++aBroadcaster )
- ModifyListenerHelper::removeListener( *aBroadcaster, xModifyEventForwarder );
- for( aBroadcaster = aNewBroadcasters.begin(); aBroadcaster != aNewBroadcasters.end(); ++aBroadcaster )
- ModifyListenerHelper::addListener( *aBroadcaster, xModifyEventForwarder );
+ for (auto const& oldBroadcaster : aOldBroadcasters)
+ ModifyListenerHelper::removeListener(oldBroadcaster, xModifyEventForwarder );
+ for (auto const& newBroadcaster : aNewBroadcasters)
+ ModifyListenerHelper::addListener( newBroadcaster, xModifyEventForwarder );
}
// ____ XAxis ____
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index ff805227b3f5..f9179ac9dc4a 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -99,10 +99,9 @@ void lcl_CloneAttributedDataPoints(
const lcl_tDataPointMap & rSource, lcl_tDataPointMap & rDestination,
const uno::Reference< uno::XInterface > & xSeries )
{
- for( lcl_tDataPointMap::const_iterator aIt( rSource.begin());
- aIt != rSource.end(); ++aIt )
+ for (auto const& elem : rSource)
{
- Reference< beans::XPropertySet > xPoint( (*aIt).second );
+ Reference< beans::XPropertySet > xPoint( elem.second );
if( xPoint.is())
{
Reference< util::XCloneable > xCloneable( xPoint, uno::UNO_QUERY );
@@ -112,7 +111,7 @@ void lcl_CloneAttributedDataPoints(
if( xPoint.is())
{
lcl_SetParent( xPoint, xSeries );
- rDestination.emplace( (*aIt).first, xPoint );
+ rDestination.emplace( elem.first, xPoint );
}
}
}
diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx
index 6e443c948fe4..131202e082fb 100644
--- a/chart2/source/model/template/AreaChartTypeTemplate.cxx
+++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx
@@ -186,11 +186,10 @@ void SAL_CALL AreaChartTypeTemplate::resetStyles( const Reference< chart2::XDiag
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
uno::Any aLineStyleAny( drawing::LineStyle_NONE );
- for( std::vector< Reference< chart2::XDataSeries > >::iterator aIt( aSeriesVec.begin());
- aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertyState > xState( *aIt, uno::UNO_QUERY );
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
+ Reference< beans::XPropertyState > xState(series, uno::UNO_QUERY);
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
if( xState.is() &&
xProp.is() &&
xProp->getPropertyValue( "BorderStyle") == aLineStyleAny )
diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx
index 3845ae98d039..226bb6b509b5 100644
--- a/chart2/source/model/template/BarChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BarChartTypeTemplate.cxx
@@ -271,10 +271,9 @@ void SAL_CALL BarChartTypeTemplate::resetStyles(
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
uno::Any aLineStyleAny( drawing::LineStyle_NONE );
- for( std::vector< Reference< chart2::XDataSeries > >::iterator aIt( aSeriesVec.begin());
- aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertyState > xState( *aIt, uno::UNO_QUERY );
+ Reference< beans::XPropertyState > xState(series, uno::UNO_QUERY);
if( xState.is())
{
if( getDimension() == 3 )
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index 445bc3598df7..a29d49afd2c0 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -102,16 +102,13 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
}
// create DataSeries
- vector< Reference< data::XLabeledDataSequence > >::const_iterator
- aSequencesVecIt = aSequencesVec.begin();
-
sal_Int32 nSeriesIndex = 0;
vector< Reference< XDataSeries > > aSeriesVec;
aSeriesVec.reserve( aSequencesVec.size());
- for( ;aSequencesVecIt != aSequencesVec.end(); ++aSequencesVecIt, ++nSeriesIndex )
+ for (auto const& elem : aSequencesVec)
{
- Sequence< Reference< data::XLabeledDataSequence > > aNewData( & (*aSequencesVecIt), 1 );
+ Sequence< Reference< data::XLabeledDataSequence > > aNewData( &elem, 1 );
Reference< XDataSeries > xSeries;
if( nSeriesIndex < aSeriesToReUse.getLength())
xSeries.set( aSeriesToReUse[nSeriesIndex] );
@@ -123,6 +120,7 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
xSink->setData( aNewData );
aSeriesVec.push_back( xSeries );
+ ++nSeriesIndex;
}
Sequence< Sequence< Reference< XDataSeries > > > aSeries(1);
diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx
index 58adeffc6659..f6b76550b9cc 100644
--- a/chart2/source/model/template/LineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.cxx
@@ -207,14 +207,13 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for( std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
try
{
chart2::Symbol aSymbProp;
drawing::LineStyle eLineStyle;
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
bool bCurrentHasSymbol = (xProp->getPropertyValue( "Symbol") >>= aSymbProp) &&
(aSymbProp.Style != chart2::SymbolStyle_NONE);
diff --git a/chart2/source/model/template/NetChartTypeTemplate.cxx b/chart2/source/model/template/NetChartTypeTemplate.cxx
index 9cea513a8f8d..b10f0f64299c 100644
--- a/chart2/source/model/template/NetChartTypeTemplate.cxx
+++ b/chart2/source/model/template/NetChartTypeTemplate.cxx
@@ -103,14 +103,13 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for( std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
try
{
chart2::Symbol aSymbProp;
drawing::LineStyle eLineStyle;
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
bool bCurrentHasSymbol = (xProp->getPropertyValue( "Symbol") >>= aSymbProp) &&
(aSymbProp.Style != chart2::SymbolStyle_NONE);
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index b7b9f109df0c..2ce05a6fa941 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -569,10 +569,9 @@ void SAL_CALL PieChartTypeTemplate::resetStyles( const Reference< chart2::XDiagr
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
uno::Any aLineStyleAny( drawing::LineStyle_NONE );
- for( std::vector< Reference< chart2::XDataSeries > >::iterator aIt( aSeriesVec.begin());
- aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertyState > xState( *aIt, uno::UNO_QUERY );
+ Reference< beans::XPropertyState > xState(series, uno::UNO_QUERY);
if( xState.is())
{
xState->setPropertyToDefault( "VaryColorsByPoint");
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index 9e1874d82801..d64cbc368e25 100644
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -239,14 +239,13 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for( std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
try
{
chart2::Symbol aSymbProp;
drawing::LineStyle eLineStyle;
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
bool bCurrentHasSymbol = (xProp->getPropertyValue( "Symbol") >>= aSymbProp) &&
(aSymbProp.Style != chart2::SymbolStyle_NONE);
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index e53f285c472f..ae65ce7a0f40 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -263,10 +263,9 @@ void SAL_CALL StockChartTypeTemplate::resetStyles(
{
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for( std::vector< Reference< chart2::XDataSeries > >::iterator aIt( aSeriesVec.begin());
- aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY);
if( xProp.is() )
xProp->setPropertyValue( "AttachedAxisIndex", uno::Any( sal_Int32(0) ) );
}
diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx
index f7d1ec1ca2de..896b9898ebcb 100644
--- a/chart2/source/model/template/XYDataInterpreter.cxx
+++ b/chart2/source/model/template/XYDataInterpreter.cxx
@@ -100,26 +100,23 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
}
// create DataSeries
- vector< Reference< data::XLabeledDataSequence > >::const_iterator
- aSequencesVecIt = aSequencesVec.begin();
-
- sal_Int32 nSeriesIndex = 0;
vector< Reference< XDataSeries > > aSeriesVec;
aSeriesVec.reserve( aSequencesVec.size());
Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
Reference< util::XCloneable > xCloneable( xValuesX, uno::UNO_QUERY );
- for( ;aSequencesVecIt != aSequencesVec.end(); ++aSequencesVecIt, ++nSeriesIndex )
+ sal_Int32 nSeriesIndex = 0;
+ for (auto const& elem : aSequencesVec)
{
vector< Reference< data::XLabeledDataSequence > > aNewData;
- if( aSequencesVecIt != aSequencesVec.begin() && xCloneable.is() )
+ if( nSeriesIndex && xCloneable.is() )
xClonedXValues.set( xCloneable->createClone(), uno::UNO_QUERY );
if( xValuesX.is() )
aNewData.push_back( xClonedXValues );
- aNewData.push_back( *aSequencesVecIt );
+ aNewData.push_back(elem);
Reference< XDataSeries > xSeries;
if( nSeriesIndex < aSeriesToReUse.getLength())
@@ -132,6 +129,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
xSink->setData( comphelper::containerToSequence( aNewData ) );
aSeriesVec.push_back( xSeries );
+ ++nSeriesIndex;
}
Sequence< Sequence< Reference< XDataSeries > > > aSeries(1);
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index ecde1f639144..32c7ce3608bc 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -298,19 +298,18 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
{
sal_Int32 nMaxFreq = 0;
// find most frequent key
- for( tNumberformatFrequency::const_iterator aIt = aKeyMap.begin();
- aIt != aKeyMap.end(); ++aIt )
+ for (auto const& elem : aKeyMap)
{
SAL_INFO(
"chart2.tools",
- "NumberFormatKey " << (*aIt).first << " appears "
- << (*aIt).second << " times");
+ "NumberFormatKey " << elem.first << " appears "
+ << elem.second << " times");
// all values must at least be 1
- if( (*aIt).second > nMaxFreq )
+ if( elem.second > nMaxFreq )
{
- nNumberFormatKey = (*aIt).first;
+ nNumberFormatKey = elem.first;
bNumberFormatKeyFoundViaAttachedData = true;
- nMaxFreq = (*aIt).second;
+ nMaxFreq = elem.second;
}
}
}
@@ -510,10 +509,9 @@ void AxisHelper::hideAxisIfNoDataIsAttached( const Reference< XAxis >& xAxis, co
//axis is hidden if no data is attached anymore but data is available
bool bOtherSeriesAttachedToThisAxis = false;
std::vector< Reference< chart2::XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt = aSeriesVector.begin();
- for( ; aIt != aSeriesVector.end(); ++aIt)
+ for (auto const& series : aSeriesVector)
{
- uno::Reference< chart2::XAxis > xCurrentAxis( DiagramHelper::getAttachedAxis( *aIt, xDiagram ), uno::UNO_QUERY );
+ uno::Reference< chart2::XAxis > xCurrentAxis( DiagramHelper::getAttachedAxis(series, xDiagram ), uno::UNO_QUERY );
if( xCurrentAxis==xAxis )
{
bOtherSeriesAttachedToThisAxis = true;
@@ -1151,13 +1149,12 @@ Reference< XChartType > AxisHelper::getFirstChartTypeWithSeriesAttachedToAxisInd
{
Reference< XChartType > xChartType;
std::vector< Reference< XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- std::vector< Reference< XDataSeries > >::const_iterator aIter = aSeriesVector.begin();
- for( ; aIter != aSeriesVector.end(); ++aIter )
+ for (auto const& series : aSeriesVector)
{
- sal_Int32 nCurrentIndex = DataSeriesHelper::getAttachedAxisIndex( *aIter );
+ sal_Int32 nCurrentIndex = DataSeriesHelper::getAttachedAxisIndex(series);
if( nAttachedAxisIndex == nCurrentIndex )
{
- xChartType = DiagramHelper::getChartTypeOfSeries( xDiagram, *aIter );
+ xChartType = DiagramHelper::getChartTypeOfSeries(xDiagram, series);
if(xChartType.is())
break;
}
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index d946b3f9a62c..e05c014cddce 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -422,12 +422,10 @@ void setStackModeAtSeries(
aAxisIndexSet.insert(0);
}
- for( std::set< sal_Int32 >::const_iterator aIt = aAxisIndexSet.begin();
- aIt != aAxisIndexSet.end(); ++aIt )
+ for (auto const& axisIndex : aAxisIndexSet)
{
- sal_Int32 nAxisIndex = *aIt;
Reference< chart2::XAxis > xAxis(
- xCorrespondingCoordinateSystem->getAxisByDimension( 1, nAxisIndex ));
+ xCorrespondingCoordinateSystem->getAxisByDimension(1, axisIndex));
if( xAxis.is())
{
bool bPercent = (eStackMode == StackMode::YStackedPercent);
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 768b75c7ca3c..4f649239caa0 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -269,12 +269,11 @@ uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges(
lcl_addRanges( aResult, xCategories );
std::vector< uno::Reference< XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
- for( std::vector< uno::Reference< XDataSeries > >::const_iterator aSeriesIt( aSeriesVector.begin() )
- ; aSeriesIt != aSeriesVector.end(); ++aSeriesIt )
+ for (auto const& series : aSeriesVector)
{
- uno::Reference< data::XDataSource > xDataSource( *aSeriesIt, uno::UNO_QUERY );
+ uno::Reference< data::XDataSource > xDataSource(series, uno::UNO_QUERY);
lcl_addDataSourceRanges( aResult, xDataSource );
- lcl_addErrorBarRanges( aResult, *aSeriesIt );
+ lcl_addErrorBarRanges( aResult, series );
}
}
@@ -304,10 +303,9 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
aResult.push_back( xCategories );
std::vector< uno::Reference< XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( xChartModel ) );
- for( std::vector< uno::Reference< XDataSeries > >::const_iterator aSeriesIt( aSeriesVector.begin() )
- ; aSeriesIt != aSeriesVector.end(); ++aSeriesIt )
+ for (auto const& series : aSeriesVector)
{
- uno::Reference< data::XDataSource > xDataSource( *aSeriesIt, uno::UNO_QUERY );
+ uno::Reference< data::XDataSource > xDataSource(series, uno::UNO_QUERY);
if( !xDataSource.is() )
continue;
uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
@@ -330,10 +328,9 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
aResult.push_back( xCategories );
std::vector< uno::Reference< XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( rModel ) );
- for( std::vector< uno::Reference< XDataSeries > >::const_iterator aSeriesIt( aSeriesVector.begin() )
- ; aSeriesIt != aSeriesVector.end(); ++aSeriesIt )
+ for (auto const& series : aSeriesVector)
{
- uno::Reference< data::XDataSource > xDataSource( *aSeriesIt, uno::UNO_QUERY );
+ uno::Reference< data::XDataSource > xDataSource(series, uno::UNO_QUERY);
if( !xDataSource.is() )
continue;
uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 5d1c3e7c6a90..0b710adac5b3 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -860,12 +860,9 @@ void DiagramHelper::setCategoriesToDiagram(
std::vector< Reference< chart2::XAxis > > aCatAxes(
lcl_getAxisHoldingCategoriesFromDiagram( xDiagram ));
- std::vector< Reference< chart2::XAxis > >::iterator aIt( aCatAxes.begin() );
- std::vector< Reference< chart2::XAxis > >::const_iterator aEnd( aCatAxes.end() );
-
- for( aIt = aCatAxes.begin(); aIt != aEnd; ++aIt )
+ for (auto const& elem : aCatAxes)
{
- Reference< chart2::XAxis > xCatAxis(*aIt);
+ Reference< chart2::XAxis > xCatAxis(elem);
if( xCatAxis.is())
{
ScaleData aScaleData( xCatAxis->getScaleData());
@@ -892,12 +889,10 @@ Reference< data::XLabeledDataSequence >
{
std::vector< Reference< chart2::XAxis > > aCatAxes(
lcl_getAxisHoldingCategoriesFromDiagram( xDiagram ));
- std::vector< Reference< chart2::XAxis > >::iterator aIt( aCatAxes.begin() );
- std::vector< Reference< chart2::XAxis > >::const_iterator aEnd( aCatAxes.end() );
//search for first categories
- if( aIt != aEnd )
+ if (!aCatAxes.empty())
{
- Reference< chart2::XAxis > xCatAxis(*aIt);
+ Reference< chart2::XAxis > xCatAxis(aCatAxes[0]);
if( xCatAxis.is())
{
ScaleData aScaleData( xCatAxis->getScaleData());
@@ -1505,13 +1500,12 @@ sal_Int32 DiagramHelper::getGeometry3D(
if( aSeriesVec.empty())
rbAmbiguous = true;
- for( std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
try
{
sal_Int32 nGeom = 0;
- Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProp(series, uno::UNO_QUERY_THROW);
if( xProp->getPropertyValue( "Geometry3D") >>= nGeom )
{
if( ! rbFound )
@@ -1544,11 +1538,10 @@ void DiagramHelper::setGeometry3D(
std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for( std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
- aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+ for (auto const& series : aSeriesVec)
{
DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(
- *aIt, "Geometry3D", uno::Any( nNewGeometry ));
+ series, "Geometry3D", uno::Any( nNewGeometry ));
}
}
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 443de9e233e2..0fb965d14706 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -153,13 +153,10 @@ sal_Int32 ExplicitCategoriesProvider::getCategoryLevelCount() const
std::vector<sal_Int32> lcl_getLimitingBorders( const std::vector< ComplexCategory >& rComplexCategories )
{
std::vector<sal_Int32> aLimitingBorders;
- std::vector< ComplexCategory >::const_iterator aIt( rComplexCategories.begin() );
- std::vector< ComplexCategory >::const_iterator aEnd( rComplexCategories.end() );
sal_Int32 nBorderIndex = 0; /*border below the index*/
- for( ; aIt != aEnd; ++aIt )
+ for (auto const& complexCategory : rComplexCategories)
{
- ComplexCategory aComplexCategory(*aIt);
- nBorderIndex += aComplexCategory.Count;
+ nBorderIndex += complexCategory.Count;
aLimitingBorders.push_back(nBorderIndex);
}
return aLimitingBorders;
@@ -294,10 +291,8 @@ std::vector< ComplexCategory > lcl_DataSequenceToComplexCategoryVector(
sal_Int32 lcl_getCategoryCount( std::vector< ComplexCategory >& rComplexCategories )
{
sal_Int32 nCount = 0;
- std::vector< ComplexCategory >::const_iterator aIt( rComplexCategories.begin() );
- std::vector< ComplexCategory >::const_iterator aEnd( rComplexCategories.end() );
- for( ; aIt != aEnd; ++aIt )
- nCount+=aIt->Count;
+ for (auto const& complexCategory : rComplexCategories)
+ nCount+=complexCategory.Count;
return nCount;
}
@@ -318,25 +313,22 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
rSplitCategoriesProvider.getStringsForLevel(nL), aLimitingBorders, nL==(nLCount-1) ) );
}
- std::vector< std::vector< ComplexCategory > >::iterator aOuterIt( rComplexCats.begin() );
- std::vector< std::vector< ComplexCategory > >::const_iterator aOuterEnd( rComplexCats.end() );
-
//ensure that the category count is the same on each level
sal_Int32 nMaxCategoryCount = 0;
{
- for( aOuterIt=rComplexCats.begin(); aOuterIt != aOuterEnd; ++aOuterIt )
+ for (auto & complexCat : rComplexCats)
{
- sal_Int32 nCurrentCount = lcl_getCategoryCount( *aOuterIt );
+ sal_Int32 nCurrentCount = lcl_getCategoryCount(complexCat);
nMaxCategoryCount = std::max( nCurrentCount, nMaxCategoryCount );
}
- for( aOuterIt=rComplexCats.begin(); aOuterIt != aOuterEnd; ++aOuterIt )
+ for (auto & complexCat : rComplexCats)
{
- if ( !aOuterIt->empty() )
+ if ( !complexCat.empty() )
{
- sal_Int32 nCurrentCount = lcl_getCategoryCount( *aOuterIt );
+ sal_Int32 nCurrentCount = lcl_getCategoryCount(complexCat);
if( nCurrentCount< nMaxCategoryCount )
{
- ComplexCategory& rComplexCategory = aOuterIt->back();
+ ComplexCategory& rComplexCategory = complexCat.back();
rComplexCategory.Count += (nMaxCategoryCount-nCurrentCount);
}
}
@@ -345,17 +337,14 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
//create a list with an element for every index
std::vector< std::vector< ComplexCategory > > aComplexCatsPerIndex;
- for( aOuterIt=rComplexCats.begin() ; aOuterIt != aOuterEnd; ++aOuterIt )
+ for (auto const& complexCat : rComplexCats)
{
std::vector< ComplexCategory > aSingleLevel;
- std::vector< ComplexCategory >::iterator aIt( aOuterIt->begin() );
- std::vector< ComplexCategory >::const_iterator aEnd( aOuterIt->end() );
- for( ; aIt != aEnd; ++aIt )
+ for (auto const& elem : complexCat)
{
- ComplexCategory aComplexCategory( *aIt );
- sal_Int32 nCount = aComplexCategory.Count;
+ sal_Int32 nCount = elem.Count;
while( nCount-- )
- aSingleLevel.push_back(aComplexCategory);
+ aSingleLevel.push_back(elem);
}
aComplexCatsPerIndex.push_back( aSingleLevel );
}
@@ -363,15 +352,14 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
if(nMaxCategoryCount)
{
aRet.realloc(nMaxCategoryCount);
- aOuterEnd = aComplexCatsPerIndex.end();
for(sal_Int32 nN=0; nN<nMaxCategoryCount; nN++)
{
OUString aText;
- for( aOuterIt=aComplexCatsPerIndex.begin() ; aOuterIt != aOuterEnd; ++aOuterIt )
+ for (auto const& complexCatPerIndex : aComplexCatsPerIndex)
{
- if ( static_cast<size_t>(nN) < aOuterIt->size() )
+ if ( static_cast<size_t>(nN) < complexCatPerIndex.size() )
{
- OUString aAddText = (*aOuterIt)[nN].Text;
+ OUString aAddText = complexCatPerIndex[nN].Text;
if( !aAddText.isEmpty() )
{
if(!aText.isEmpty())
More information about the Libreoffice-commits
mailing list