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

a loop

Signed-off-by: Nicu <nicu.coscodan2003@gmail.com>
Change-Id: I484cabfe59e5896e9163120666191e6404647fce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194805
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Nicu
2025-11-29 10:21:50 +01:00
committed by Ilmari Lauhakangas
parent 4b3eb51d4e
commit 0f627ec0f0
3 changed files with 4 additions and 9 deletions
+1 -3
View File
@@ -370,9 +370,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV
awt::Size aSize(nSymbolWidth, nSymbolHeight);
std::vector<ViewLegendSymbol> aNewEntries
= pSeriesPlotter->createSymbols(aSize, m_xTarget, m_xComponentContext);
for (auto const& rSymbol : aNewEntries)
aSymbols.push_back(rSymbol);
aSymbols.insert(aSymbols.end(), aNewEntries.begin(), aNewEntries.end());
}
}
}
@@ -121,8 +121,7 @@ namespace pcr
std::vector<sal_Int16> aRetSelection;
auto aSelection = m_xEntries->get_selected_rows();
aRetSelection.reserve(aSelection.size());
for (auto row : aSelection)
aRetSelection.push_back(row);
aRetSelection.insert(aRetSelection.end(), aSelection.begin(), aSelection.end());
return aRetSelection;
}
@@ -490,8 +490,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati
AcceleratorCache::TKeyList lSecondaryKeys = impl_getCFG(false).getAllKeys(); //get keys from SecondaryKeys set
lKeys.reserve(lKeys.size()+lSecondaryKeys.size());
for (auto const& secondaryKey : lSecondaryKeys)
lKeys.push_back(secondaryKey);
lKeys.insert(lKeys.end(), lSecondaryKeys.begin(), lSecondaryKeys.end());
return comphelper::containerToSequence(lKeys);
}
@@ -651,8 +650,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati
AcceleratorCache::TKeyList lKeys = rPrimaryCache.getKeysByCommand(sCommand);
AcceleratorCache::TKeyList lSecondaryKeys = rSecondaryCache.getKeysByCommand(sCommand);
for (auto const& secondaryKey : lSecondaryKeys)
lKeys.push_back(secondaryKey);
lKeys.insert(lKeys.end(), lSecondaryKeys.begin(), lSecondaryKeys.end());
return comphelper::containerToSequence(lKeys);
}