chart2/source/model/main/Axis.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 4ce8861dd5a5955a2fc5af3d6c20166bbfe71bf2 Author: codemaestro <[email protected]> AuthorDate: Fri Oct 17 19:05:07 2025 +0530 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Mon Oct 20 12:18:13 2025 +0200 tdf#163738 Use insert() to add multiple values in containers instead of a loop Change-Id: Ia8d4fa56dcb1e3b105a38b083365e35927d38384 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192582 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <[email protected]> diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index 9fe2333776bf..77310b8fd696 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -369,8 +369,11 @@ void Axis::AllocateSubGrids() if( nOldSubIncCount > nNewSubIncCount ) { // remove superfluous entries - for( sal_Int32 i = nNewSubIncCount; i < nOldSubIncCount; ++i ) - aOldBroadcasters.push_back( m_aSubGridProperties[ i ] ); + aOldBroadcasters.insert( + aOldBroadcasters.end(), + m_aSubGridProperties.begin() + nNewSubIncCount, + m_aSubGridProperties.end()); + m_aSubGridProperties.resize( nNewSubIncCount ); } else if( nOldSubIncCount < nNewSubIncCount )
