tdf#163738 Use insert() to add multiple values in containers

instead of loop

Replace push_back with corresponding insert without changing the
behaviour of the code

Change-Id: Ib09ee67400131d68ce84148b8affcc881aecdd38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203415
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Mehul Sharma
2026-04-11 07:24:04 +02:00
committed by Ilmari Lauhakangas
parent bf3d9c3520
commit 4381d485fc
3 changed files with 3 additions and 10 deletions
+1 -4
View File
@@ -392,10 +392,7 @@ void SAL_CALL DataSeries::setData( const uno::Sequence< Reference< chart2::data:
MutexGuard aGuard( m_aMutex );
xModifyEventForwarder = m_xModifyEventForwarder;
std::swap( aOldDataSequences, m_aDataSequences );
for (const auto & i : aData)
{
aNewDataSequences.push_back(i);
}
aNewDataSequences.insert(aNewDataSequences.end(), aData.begin(), aData.end());
m_aDataSequences = aNewDataSequences;
}
ModifyListenerHelper::removeListenerFromAllElements( aOldDataSequences, xModifyEventForwarder );
+1 -4
View File
@@ -233,10 +233,7 @@ void LwpStory::SortPageLayout()
//put all the sorted layouts into list
m_LayoutList.clear();
for (auto const& layout : aLayoutList)
{
m_LayoutList.push_back(layout);
}
m_LayoutList.insert(m_LayoutList.end(), aLayoutList.begin(), aLayoutList.end());
}
/**************************************************************************
+1 -2
View File
@@ -3906,8 +3906,7 @@ void SalInstanceTreeView::columns_autosize()
{
std::vector<int> aColWidths;
aColWidths.push_back(aWidths[1] + aWidths[0]);
for (size_t i = 2; i < aWidths.size(); ++i)
aColWidths.push_back(aWidths[i]);
aColWidths.insert(aColWidths.end(), aWidths.begin() + 2, aWidths.end());
// take column headers into account
if (VclPtr<SvHeaderTabListBox> pTabListBox