summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-05-31 15:26:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-05-31 19:08:24 +0200
commit66500b5041135dbca62f10c8b20ce000a2ae43ff (patch)
treebe8a442ef2d34909147938e82fffbff5d8bb6bd7 /chart2
parent52da30cd18990c47b5cea0e789f3d1f76c2a9e1b (diff)
Use some range-based for loops
Change-Id: I4935bf51c6c7e9be1e3f069c6c72e618eaa0b4a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135189 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx8
-rw-r--r--chart2/source/tools/CommonConverters.cxx8
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx4
3 files changed, 10 insertions, 10 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index b11411cac41b..44e1413befe0 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -791,10 +791,10 @@ void DataBrowserModel::updateFromModel()
const std::vector< rtl::Reference< ChartType > > aChartTypes( coords->getChartTypes2());
sal_Int32 nXAxisNumberFormat = DataSeriesHelper::getNumberFormatKeyFromAxis( nullptr, coords, 0, 0 );
- for( sal_Int32 nCTIdx=0; nCTIdx < static_cast<sal_Int32>(aChartTypes.size()); ++nCTIdx )
+ for( auto const & CT: aChartTypes )
{
- rtl::Reference< ChartType > xSeriesCnt( aChartTypes[nCTIdx] );
- OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] );
+ rtl::Reference< ChartType > xSeriesCnt( CT );
+ OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( CT );
const std::vector< rtl::Reference< DataSeries > > & aSeries( xSeriesCnt->getDataSeries2());
lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
@@ -871,7 +871,7 @@ void DataBrowserModel::updateFromModel()
m_aHeaders.emplace_back(
dataSeries,
- aChartTypes[nCTIdx],
+ CT,
bSwapXAndYAxis,
nHeaderStart,
nHeaderEnd - 1 );
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index b68cd17e20c3..e10c22cc7d55 100644
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -397,17 +397,17 @@ basegfx::B2DPolyPolygon PolyToB2DPolyPolygon(
{
basegfx::B2DPolyPolygon aRetval;
- for(sal_Int32 nN = 0; nN < static_cast<sal_Int32>(rPolyPolygon.size()); nN++)
+ for(auto const & nN: rPolyPolygon)
{
basegfx::B2DPolygon aNewPolygon;
- sal_Int32 nInnerLength = rPolyPolygon[nN].size();
+ sal_Int32 nInnerLength = nN.size();
if(nInnerLength)
{
aNewPolygon.reserve(nInnerLength);
for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
{
- auto X = static_cast<sal_Int32>(rPolyPolygon[nN][nM].PositionX);
- auto Y = static_cast<sal_Int32>(rPolyPolygon[nN][nM].PositionY);
+ auto X = static_cast<sal_Int32>(nN[nM].PositionX);
+ auto Y = static_cast<sal_Int32>(nN[nM].PositionY);
aNewPolygon.append(basegfx::B2DPoint(X, Y));
}
// check for closed state flag
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index b14ea4e18878..0ea37f9a7848 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -1580,11 +1580,11 @@ sal_Int32 VCartesianAxis::estimateMaximumAutoMainIncrementCount()
FixedNumberFormatter aFixedNumberFormatterTest(m_xNumberFormatsSupplier, m_aAxisLabelProperties.m_nNumberFormatKey);
OUString sPreviousValueLabel;
sal_Int32 nSameLabel = 0;
- for (sal_Int32 nLabel = 0; nLabel < static_cast<sal_Int32>(m_aAllTickInfos[0].size()); ++nLabel)
+ for (auto const & nLabel: m_aAllTickInfos[0])
{
Color nColor = COL_AUTO;
bool bHasColor = false;
- OUString sValueLabel = aFixedNumberFormatterTest.getFormattedString(m_aAllTickInfos[0][nLabel].fScaledTickValue, nColor, bHasColor);
+ OUString sValueLabel = aFixedNumberFormatterTest.getFormattedString(nLabel.fScaledTickValue, nColor, bHasColor);
if (sValueLabel == sPreviousValueLabel)
{
nSameLabel++;