diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-11-26 15:53:36 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-11-26 16:48:56 +0100 |
commit | ae3a10fc86620250363724d5634c09a9f61f91be (patch) | |
tree | 1fb5c250d61631215561ff3e7afff478c98b1771 /xmloff/source/chart | |
parent | 897c07bda2d116bcc2fa4a64c1eb75a52651c991 (diff) |
Modernize by using for-range loops (xmloff/chart)
Change-Id: I505ac79e76738ce39d1768451e7c213246eec88d
Reviewed-on: https://gerrit.libreoffice.org/45289
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 57 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLSeries2Context.cxx | 131 |
2 files changed, 80 insertions, 108 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 0bc45256a597..10f3c9345e16 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -481,12 +481,10 @@ struct NewDonutSeries aRet.push_back( aSeriesStyle ); sal_Int32 nPointIndex=0; - ::std::vector< OUString >::iterator aPointIt( m_aPointStyles.begin() ); - ::std::vector< OUString >::iterator aPointEnd( m_aPointStyles.end() ); - while( aPointIt != aPointEnd ) + for (auto const& pointStyle : m_aPointStyles) { DataRowPointStyle aPointStyle( DataRowPointStyle::DATA_POINT - , m_xSeries, nPointIndex, 1, *aPointIt, mnAttachedAxis ); + , m_xSeries, nPointIndex, 1, pointStyle, mnAttachedAxis ); if( nPointIndex < static_cast<sal_Int32>(m_aSeriesStyles.size()) ) { aPointStyle.msSeriesStyleNameForDonuts = m_aSeriesStyles[nPointIndex]; @@ -494,7 +492,6 @@ struct NewDonutSeries if( !aPointStyle.msSeriesStyleNameForDonuts.isEmpty() || !aPointStyle.msStyleName.isEmpty() ) aRet.push_back( aPointStyle ); - ++aPointIt; ++nPointIndex; } @@ -505,9 +502,6 @@ struct NewDonutSeries void lcl_swapPointAndSeriesStylesForDonutCharts( ::std::vector< DataRowPointStyle >& rStyleVector , const ::std::map< css::uno::Reference< css::chart2::XDataSeries> , sal_Int32 >& rSeriesMap ) { - ::std::vector< DataRowPointStyle >::iterator aIt(rStyleVector.begin()); - ::std::vector< DataRowPointStyle >::iterator aEnd(rStyleVector.end()); - //detect old series count //and add old series to aSeriesMap ::std::map< css::uno::Reference< @@ -516,9 +510,9 @@ void lcl_swapPointAndSeriesStylesForDonutCharts( ::std::vector< DataRowPointStyl { sal_Int32 nMaxOldSeriesIndex = 0; sal_Int32 nOldSeriesIndex = 0; - for( aIt = rStyleVector.begin(); aIt != aEnd; ++aIt ) + for (auto const& style : rStyleVector) { - DataRowPointStyle aStyle(*aIt); + DataRowPointStyle aStyle(style); if(aStyle.meType == DataRowPointStyle::DATA_SERIES && aStyle.m_xSeries.is() ) { @@ -534,62 +528,55 @@ void lcl_swapPointAndSeriesStylesForDonutCharts( ::std::vector< DataRowPointStyl } //initialize new series styles - ::std::map< Reference< chart2::XDataSeries >, sal_Int32 >::const_iterator aSeriesMapIt( aSeriesMap.begin() ); ::std::map< Reference< chart2::XDataSeries >, sal_Int32 >::const_iterator aSeriesMapEnd( aSeriesMap.end() ); //sort by index ::std::vector< NewDonutSeries > aNewSeriesVector; { ::std::map< sal_Int32, Reference< chart2::XDataSeries > > aIndexSeriesMap; - for( ; aSeriesMapIt != aSeriesMapEnd; ++aSeriesMapIt ) - aIndexSeriesMap[aSeriesMapIt->second] = aSeriesMapIt->first; - - ::std::map< sal_Int32, Reference< chart2::XDataSeries > >::const_iterator aIndexIt( aIndexSeriesMap.begin() ); - ::std::map< sal_Int32, Reference< chart2::XDataSeries > >::const_iterator aIndexEnd( aIndexSeriesMap.end() ); + for (auto const& series : aSeriesMap) + aIndexSeriesMap[series.second] = series.first; - for( ; aIndexIt != aIndexEnd; ++aIndexIt ) - aNewSeriesVector.emplace_back(aIndexIt->second,nOldSeriesCount ); + for (auto const& indexSeries : aIndexSeriesMap) + aNewSeriesVector.emplace_back(indexSeries.second,nOldSeriesCount ); } //overwrite attached axis information according to old series styles - for( aIt = rStyleVector.begin(); aIt != aEnd; ++aIt ) + for (auto const& style : rStyleVector) { - DataRowPointStyle aStyle(*aIt); + DataRowPointStyle aStyle(style); if(aStyle.meType == DataRowPointStyle::DATA_SERIES ) { - aSeriesMapIt = aSeriesMap.find( aStyle.m_xSeries ); + auto aSeriesMapIt = aSeriesMap.find( aStyle.m_xSeries ); if( aSeriesMapIt != aSeriesMapEnd && aSeriesMapIt->second < static_cast<sal_Int32>(aNewSeriesVector.size()) ) aNewSeriesVector[aSeriesMapIt->second].mnAttachedAxis = aStyle.mnAttachedAxis; } } //overwrite new series style names with old series style name information - for( aIt = rStyleVector.begin(); aIt != aEnd; ++aIt ) + for (auto const& style : rStyleVector) { - DataRowPointStyle aStyle(*aIt); + DataRowPointStyle aStyle(style); if( aStyle.meType == DataRowPointStyle::DATA_SERIES ) { - aSeriesMapIt = aSeriesMap.find(aStyle.m_xSeries); + auto aSeriesMapIt = aSeriesMap.find(aStyle.m_xSeries); if( aSeriesMapEnd != aSeriesMapIt ) { sal_Int32 nNewPointIndex = aSeriesMapIt->second; - ::std::vector< NewDonutSeries >::iterator aNewSeriesIt( aNewSeriesVector.begin() ); - ::std::vector< NewDonutSeries >::iterator aNewSeriesEnd( aNewSeriesVector.end() ); - - for( ;aNewSeriesIt!=aNewSeriesEnd; ++aNewSeriesIt) - aNewSeriesIt->setSeriesStyleNameToPoint( aStyle.msStyleName, nNewPointIndex ); + for (auto & newSeries : aNewSeriesVector) + newSeries.setSeriesStyleNameToPoint( aStyle.msStyleName, nNewPointIndex ); } } } //overwrite new series style names with point style name information - for( aIt = rStyleVector.begin(); aIt != aEnd; ++aIt ) + for (auto const& style : rStyleVector) { - DataRowPointStyle aStyle(*aIt); + DataRowPointStyle aStyle(style); if( aStyle.meType == DataRowPointStyle::DATA_POINT ) { - aSeriesMapIt = aSeriesMap.find(aStyle.m_xSeries); + auto aSeriesMapIt = aSeriesMap.find(aStyle.m_xSeries); if( aSeriesMapEnd != aSeriesMapIt ) { sal_Int32 nNewPointIndex = aSeriesMapIt->second; @@ -611,11 +598,9 @@ void lcl_swapPointAndSeriesStylesForDonutCharts( ::std::vector< DataRowPointStyl //put information from aNewSeriesVector to output parameter rStyleVector rStyleVector.clear(); - ::std::vector< NewDonutSeries >::iterator aNewSeriesIt( aNewSeriesVector.begin() ); - ::std::vector< NewDonutSeries >::iterator aNewSeriesEnd( aNewSeriesVector.end() ); - for( ;aNewSeriesIt!=aNewSeriesEnd; ++aNewSeriesIt) + for (auto & newSeries : aNewSeriesVector) { - ::std::vector< DataRowPointStyle > aVector( aNewSeriesIt->creatStyleVector() ); + ::std::vector< DataRowPointStyle > aVector( newSeries.creatStyleVector() ); rStyleVector.insert(rStyleVector.end(),aVector.begin(),aVector.end()); } } diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 8072cf49ba52..82b6662771c6 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -624,11 +624,10 @@ void SchXMLSeries2Context::EndElement() if( !bDeleteSeries ) { - for( tSchXMLLSequencesPerIndex::const_iterator aIt( maPostponedSequences.begin()); - aIt != maPostponedSequences.end(); ++aIt ) + for (auto const& postponedSequence : maPostponedSequences) { - sal_Int32 nNewIndex = aIt->first.first + nDomainCount; - mrLSequencesPerIndex.emplace( tSchXMLIndexWithPart( nNewIndex, aIt->first.second ), aIt->second ); + sal_Int32 nNewIndex = postponedSequence.first.first + nDomainCount; + mrLSequencesPerIndex.emplace( tSchXMLIndexWithPart( nNewIndex, postponedSequence.first.second ), postponedSequence.second ); } m_rGlobalSeriesImportInfo.nCurrentDataIndex++; } @@ -700,47 +699,44 @@ SvXMLImportContextRef SchXMLSeries2Context::CreateChildContext( void SchXMLSeries2Context::initSeriesPropertySets( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles , const uno::Reference< frame::XModel >& xChartModel ) { - ::std::vector< DataRowPointStyle >::iterator iStyle; - // iterate over series first and remind propertysets in map // new api <-> old api wrapper ::std::map< Reference< chart2::XDataSeries >, Reference< beans::XPropertySet > > aSeriesMap; - for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleVector.end(); ++iStyle ) + for (auto & seriesStyle : rSeriesDefaultsAndStyles.maSeriesStyleVector) { - if( iStyle->meType != DataRowPointStyle::DATA_SERIES ) + if( seriesStyle.meType != DataRowPointStyle::DATA_SERIES ) continue; - if( !iStyle->m_xOldAPISeries.is() ) - iStyle->m_xOldAPISeries = SchXMLSeriesHelper::createOldAPISeriesPropertySet( iStyle->m_xSeries, xChartModel ); + if( !seriesStyle.m_xOldAPISeries.is() ) + seriesStyle.m_xOldAPISeries = SchXMLSeriesHelper::createOldAPISeriesPropertySet( seriesStyle.m_xSeries, xChartModel ); - aSeriesMap[iStyle->m_xSeries] = iStyle->m_xOldAPISeries; + aSeriesMap[seriesStyle.m_xSeries] = seriesStyle.m_xOldAPISeries; } //initialize m_xOldAPISeries for all other styles also - for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleVector.end(); ++iStyle ) + for (auto & seriesStyle : rSeriesDefaultsAndStyles.maSeriesStyleVector) { - if( iStyle->meType == DataRowPointStyle::DATA_SERIES ) + if( seriesStyle.meType == DataRowPointStyle::DATA_SERIES ) continue; - iStyle->m_xOldAPISeries = aSeriesMap[iStyle->m_xSeries]; + seriesStyle.m_xOldAPISeries = aSeriesMap[seriesStyle.m_xSeries]; } } //static void SchXMLSeries2Context::setDefaultsToSeries( SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles ) { - ::std::vector< DataRowPointStyle >::iterator iStyle; // iterate over series // call initSeriesPropertySets first - for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleVector.end(); ++iStyle ) + for (auto & seriesStyle : rSeriesDefaultsAndStyles.maSeriesStyleVector) { - if( iStyle->meType != DataRowPointStyle::DATA_SERIES ) + if( seriesStyle.meType != DataRowPointStyle::DATA_SERIES ) continue; try { - uno::Reference< beans::XPropertySet > xSeries( iStyle->m_xOldAPISeries ); + uno::Reference< beans::XPropertySet > xSeries( seriesStyle.m_xOldAPISeries ); if( !xSeries.is() ) continue; @@ -784,30 +780,28 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe , bool bIsStockChart , tSchXMLLSequencesPerIndex & rInOutLSequencesPerIndex ) { - ::std::vector< DataRowPointStyle >::iterator iStyle; - // iterate over series - for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleVector.end(); ++iStyle ) + for (auto & seriesStyle : rSeriesDefaultsAndStyles.maSeriesStyleVector) { - if( iStyle->meType == DataRowPointStyle::DATA_SERIES ) + if( seriesStyle.meType == DataRowPointStyle::DATA_SERIES ) { try { - uno::Reference< beans::XPropertySet > xSeriesProp( iStyle->m_xOldAPISeries ); + uno::Reference< beans::XPropertySet > xSeriesProp( seriesStyle.m_xOldAPISeries ); if( !xSeriesProp.is() ) continue; - if( iStyle->mnAttachedAxis != 1 ) + if( seriesStyle.mnAttachedAxis != 1 ) { xSeriesProp->setPropertyValue("Axis" , uno::makeAny(chart::ChartAxisAssign::SECONDARY_Y) ); } - if( !(iStyle->msStyleName).isEmpty()) + if( !(seriesStyle.msStyleName).isEmpty()) { - if( rCurrStyleName != iStyle->msStyleName ) + if( rCurrStyleName != seriesStyle.msStyleName ) { - rCurrStyleName = iStyle->msStyleName; + rCurrStyleName = seriesStyle.msStyleName; rpStyle = pStylesCtxt->FindStyleChildContext( SchXMLImportHelper::GetChartFamilyID(), rCurrStyleName ); } @@ -842,14 +836,14 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe bool bIsMinMaxSeries = false; if( bIsStockChart ) { - if( SchXMLSeriesHelper::isCandleStickSeries( iStyle->m_xSeries + if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries , uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ) bIsMinMaxSeries = true; } if( !bIsMinMaxSeries ) { pPropStyleContext->FillPropertySet( xSeriesProp ); - if( iStyle->mbSymbolSizeForSeriesIsMissingInFile ) + if( seriesStyle.mbSymbolSizeForSeriesIsMissingInFile ) lcl_setSymbolSizeIfNeeded( xSeriesProp, rImport ); if( bHasErrorBarRangesFromData ) lcl_insertErrorBarLSequencesToMap( rInOutLSequencesPerIndex, xSeriesProp ); @@ -872,10 +866,8 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( const SvXMLStyleContext*& rpStyle, OUString const & rCurrentStyleName ) { - std::vector< RegressionStyle >::iterator iStyle; - - // iterate over regession etc - for( iStyle = rSeriesDefaultsAndStyles.maRegressionStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maRegressionStyleVector.end(); ++iStyle ) + // iterate over regression etc + for (auto const& regressionStyle : rSeriesDefaultsAndStyles.maRegressionStyleVector) { try { @@ -896,9 +888,9 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( } } - if (!iStyle->msStyleName.isEmpty()) + if (!regressionStyle.msStyleName.isEmpty()) { - XMLPropStyleContext* pCurrent = lcl_GetStylePropContext(pStylesCtxt, rpStyle, iStyle->msStyleName); + XMLPropStyleContext* pCurrent = lcl_GetStylePropContext(pStylesCtxt, rpStyle, regressionStyle.msStyleName); if( pCurrent ) { pPropStyleContext = pCurrent; @@ -914,7 +906,7 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( { Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); Reference< chart2::XRegressionCurve > xRegCurve( xMSF->createInstance( aServiceName ), uno::UNO_QUERY_THROW ); - Reference< chart2::XRegressionCurveContainer > xRegCurveCont( iStyle->m_xSeries, uno::UNO_QUERY_THROW ); + Reference< chart2::XRegressionCurveContainer > xRegCurveCont( regressionStyle.m_xSeries, uno::UNO_QUERY_THROW ); if( xRegCurve.is()) { @@ -922,7 +914,7 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( if( pPropStyleContext != nullptr) pPropStyleContext->FillPropertySet( xCurveProperties ); - xRegCurve->setEquationProperties( iStyle->m_xEquationProperties ); + xRegCurve->setEquationProperties( regressionStyle.m_xEquationProperties ); } xRegCurveCont->addRegressionCurve( xRegCurve ); @@ -942,36 +934,34 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles , const SvXMLStyleContext*& rpStyle , OUString& rCurrStyleName ) { - ::std::vector< DataRowPointStyle >::iterator iStyle; - - // iterate over regession etc - for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleVector.end(); ++iStyle ) + // iterate over regression etc + for (auto const& seriesStyle : rSeriesDefaultsAndStyles.maSeriesStyleVector) { - if( iStyle->meType == DataRowPointStyle::ERROR_INDICATOR || - iStyle->meType == DataRowPointStyle::MEAN_VALUE ) + if( seriesStyle.meType == DataRowPointStyle::ERROR_INDICATOR || + seriesStyle.meType == DataRowPointStyle::MEAN_VALUE ) { - if ( iStyle->meType == DataRowPointStyle::ERROR_INDICATOR ) + if ( seriesStyle.meType == DataRowPointStyle::ERROR_INDICATOR ) { - uno::Reference< beans::XPropertySet > xNewSeriesProp(iStyle->m_xSeries,uno::UNO_QUERY); + uno::Reference< beans::XPropertySet > xNewSeriesProp(seriesStyle.m_xSeries,uno::UNO_QUERY); - if (iStyle->m_xErrorXProperties.is()) - xNewSeriesProp->setPropertyValue("ErrorBarX",uno::makeAny(iStyle->m_xErrorXProperties)); + if (seriesStyle.m_xErrorXProperties.is()) + xNewSeriesProp->setPropertyValue("ErrorBarX",uno::makeAny(seriesStyle.m_xErrorXProperties)); - if (iStyle->m_xErrorYProperties.is()) - xNewSeriesProp->setPropertyValue("ErrorBarY",uno::makeAny(iStyle->m_xErrorYProperties)); + if (seriesStyle.m_xErrorYProperties.is()) + xNewSeriesProp->setPropertyValue("ErrorBarY",uno::makeAny(seriesStyle.m_xErrorYProperties)); } try { - uno::Reference< beans::XPropertySet > xSeriesProp( iStyle->m_xOldAPISeries ); + uno::Reference< beans::XPropertySet > xSeriesProp( seriesStyle.m_xOldAPISeries ); if( !xSeriesProp.is() ) continue; - if( !(iStyle->msStyleName).isEmpty()) + if( !(seriesStyle.msStyleName).isEmpty()) { - if( rCurrStyleName != iStyle->msStyleName ) + if( rCurrStyleName != seriesStyle.msStyleName ) { - rCurrStyleName = iStyle->msStyleName; + rCurrStyleName = seriesStyle.msStyleName; rpStyle = pStylesCtxt->FindStyleChildContext( SchXMLImportHelper::GetChartFamilyID(), rCurrStyleName ); } @@ -983,7 +973,7 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles if( pPropStyleContext ) { Reference< beans::XPropertySet > xStatPropSet; - switch( iStyle->meType ) + switch( seriesStyle.meType ) { case DataRowPointStyle::MEAN_VALUE: xSeriesProp->getPropertyValue("DataMeanValueProperties") >>= xStatPropSet; @@ -1016,34 +1006,33 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri , const SvXMLImport& rImport , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter ) { - ::std::vector< DataRowPointStyle >::iterator iStyle; - for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleVector.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleVector.end(); ++iStyle ) + for (auto const& seriesStyle : rSeriesDefaultsAndStyles.maSeriesStyleVector) { - if( iStyle->meType != DataRowPointStyle::DATA_POINT ) + if( seriesStyle.meType != DataRowPointStyle::DATA_POINT ) continue; - if( iStyle->m_nPointIndex == -1 ) + if( seriesStyle.m_nPointIndex == -1 ) continue; //ignore datapoint properties for stock charts //... todo ... if( bIsStockChart ) { - if( SchXMLSeriesHelper::isCandleStickSeries( iStyle->m_xSeries, uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ) + if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries, uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ) continue; } // data point style - for( sal_Int32 i = 0; i < iStyle->m_nPointRepeat; i++ ) + for( sal_Int32 i = 0; i < seriesStyle.m_nPointRepeat; i++ ) { try { - uno::Reference< beans::XPropertySet > xSeriesProp( iStyle->m_xOldAPISeries ); + uno::Reference< beans::XPropertySet > xSeriesProp( seriesStyle.m_xOldAPISeries ); if(!xSeriesProp.is()) continue; uno::Reference< beans::XPropertySet > xPointProp( - SchXMLSeriesHelper::createOldAPIDataPointPropertySet( iStyle->m_xSeries, iStyle->m_nPointIndex + i + SchXMLSeriesHelper::createOldAPIDataPointPropertySet( seriesStyle.m_xSeries, seriesStyle.m_nPointIndex + i , uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ); if( !xPointProp.is() ) @@ -1052,9 +1041,9 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri if( bIsDonutChart ) { //set special series styles for donut charts first - if( rCurrStyleName != iStyle->msSeriesStyleNameForDonuts ) + if( rCurrStyleName != seriesStyle.msSeriesStyleNameForDonuts ) { - rCurrStyleName = iStyle->msSeriesStyleNameForDonuts; + rCurrStyleName = seriesStyle.msSeriesStyleNameForDonuts; rpStyle = pStylesCtxt->FindStyleChildContext( SchXMLImportHelper::GetChartFamilyID(), rCurrStyleName ); } @@ -1077,9 +1066,9 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri { } - if( rCurrStyleName != iStyle->msStyleName ) + if( rCurrStyleName != seriesStyle.msStyleName ) { - rCurrStyleName = iStyle->msStyleName; + rCurrStyleName = seriesStyle.msStyleName; rpStyle = pStylesCtxt->FindStyleChildContext( SchXMLImportHelper::GetChartFamilyID(), rCurrStyleName ); } @@ -1091,7 +1080,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri if( pPropStyleContext ) { pPropStyleContext->FillPropertySet( xPointProp ); - if( iStyle->mbSymbolSizeForSeriesIsMissingInFile ) + if( seriesStyle.mbSymbolSizeForSeriesIsMissingInFile ) lcl_resetSymbolSizeForPointsIfNecessary( xPointProp, rImport, pPropStyleContext, pStylesCtxt ); } } @@ -1106,17 +1095,15 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri //static void SchXMLSeries2Context::switchSeriesLinesOff( ::std::vector< DataRowPointStyle >& rSeriesStyleVector ) { - ::std::vector< DataRowPointStyle >::iterator iStyle; // iterate over series - - for( iStyle = rSeriesStyleVector.begin(); iStyle != rSeriesStyleVector.end(); ++iStyle ) + for (auto const& seriesStyle : rSeriesStyleVector) { - if( iStyle->meType != DataRowPointStyle::DATA_SERIES ) + if( seriesStyle.meType != DataRowPointStyle::DATA_SERIES ) continue; try { - uno::Reference< beans::XPropertySet > xSeries( iStyle->m_xOldAPISeries ); + uno::Reference< beans::XPropertySet > xSeries( seriesStyle.m_xOldAPISeries ); if( !xSeries.is() ) continue; |