diff options
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/tools/AxisHelper.cxx | 5 | ||||
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/NetChart.cxx | 3 |
3 files changed, 3 insertions, 8 deletions
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index c836d7646114..2f9a14c0442f 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -278,11 +278,8 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( if( xSeq.is() ) { sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 ); - // initialize the value - if( aKeyMap.find( nKey ) == aKeyMap.end()) - aKeyMap[ nKey ] = 0; // increase frequency - aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1); + aKeyMap[ nKey ] ++; } } } diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 0d7e88936d8f..a658a26d04a6 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -749,8 +749,7 @@ void AreaChart::createShapes() } std::map< sal_Int32, double >& rLogicYForNextSeriesMap = aLogicYForNextSeriesMapByX[nIndex]; - if( rLogicYForNextSeriesMap.find(nAttachedAxisIndex) == rLogicYForNextSeriesMap.end() ) - rLogicYForNextSeriesMap[nAttachedAxisIndex] = 0.0; + rLogicYForNextSeriesMap.try_emplace(nAttachedAxisIndex, 0.0); double fPreviousYValue = rLogicYForNextSeriesMap[nAttachedAxisIndex]; fLogicY += rLogicYForNextSeriesMap[nAttachedAxisIndex]; diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx index 2205351dfd0d..a8a0f776dd24 100644 --- a/chart2/source/view/charttypes/NetChart.cxx +++ b/chart2/source/view/charttypes/NetChart.cxx @@ -450,8 +450,7 @@ void NetChart::createShapes() continue; } - if( aLogicYForNextSeriesMap.find(nAttachedAxisIndex) == aLogicYForNextSeriesMap.end() ) - aLogicYForNextSeriesMap[nAttachedAxisIndex] = 0.0; + aLogicYForNextSeriesMap.try_emplace(nAttachedAxisIndex, 0.0); double fLogicValueForLabeDisplay = fLogicY; |