tdf#163738: Use insert() instead of push_back loops

Change-Id: If5bbf0fde172c0fd0a21e44141d7e53e0ae09cab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198445
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
shlok3640
2026-01-31 12:30:33 +01:00
committed by Ilmari Lauhakangas
parent f7588e928a
commit 19f943f134
5 changed files with 7 additions and 14 deletions
+2 -2
View File
@@ -387,8 +387,8 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
std::set<SCCOL> aColBreaks;
rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true);
for (const auto& rColBreak : aColBreaks)
maData.maVerPageBreaks.push_back(rColBreak);
maData.maVerPageBreaks.insert(maData.maVerPageBreaks.end(), aColBreaks.begin(),
aColBreaks.end());
}
namespace {
+1 -4
View File
@@ -1544,10 +1544,7 @@ ScChart2DataProvider::createDataSource(
//reorder labeled sequences according to aSequenceMapping
std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSeqVector;
aSeqVector.reserve(aSeqs.size());
for (auto const& aSeq : aSeqs)
{
aSeqVector.push_back(aSeq);
}
aSeqVector.insert(aSeqVector.end(), aSeqs.begin(), aSeqs.end());
for (const sal_Int32 nNewIndex : aSequenceMapping)
{
+1 -2
View File
@@ -1657,8 +1657,7 @@ std::vector<SwFrameFormat*> SwTextBoxHelper::CollectTextBoxes(const SdrObject* p
for (const rtl::Reference<SdrObject>& pObj : *pChildren)
{
auto pChildTextBoxes = CollectTextBoxes(pObj.get(), pFormat);
for (auto& rChildTextBox : pChildTextBoxes)
vRet.push_back(rChildTextBox);
vRet.insert(vRet.end(), pChildTextBoxes.begin(), pChildTextBoxes.end());
}
}
else
+2 -2
View File
@@ -1009,8 +1009,8 @@ void SwDrawView::DeleteMarked()
if (pObject->getChildrenOfSdrObject())
{
auto pChildTextBoxes = SwTextBoxHelper::CollectTextBoxes(pObject, pFormat);
for (auto& rChildTextBox : pChildTextBoxes)
aTextBoxesToDelete.push_back(rChildTextBox);
aTextBoxesToDelete.insert(aTextBoxesToDelete.end(), pChildTextBoxes.begin(),
pChildTextBoxes.end());
}
else if (SwFrameFormat* pTextBox
= SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT))
@@ -756,10 +756,7 @@ void SchXMLDataPointContext::startFastElement (sal_Int32 /*Element*/,
Reference<beans::XPropertySet> xSeriesProp(mDataPoint.m_xSeries, uno::UNO_QUERY);
xSeriesProp->getPropertyValue(u"DeletedLegendEntries"_ustr) >>= deletedLegendEntriesSeq;
std::vector<sal_Int32> deletedLegendEntries;
for (const auto& deletedLegendEntry : deletedLegendEntriesSeq)
{
deletedLegendEntries.push_back(deletedLegendEntry);
}
deletedLegendEntries.insert(deletedLegendEntries.end(), deletedLegendEntriesSeq.begin(), deletedLegendEntriesSeq.end());
deletedLegendEntries.push_back(mDataPoint.m_nPointIndex);
xSeriesProp->setPropertyValue(u"DeletedLegendEntries"_ustr, uno::Any(comphelper::containerToSequence(deletedLegendEntries)));
}