summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-14 14:57:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-14 21:28:40 +0200
commit1f9468fc29874eae5100317282ab8b395904406d (patch)
tree7da605653b3a979d18c2283f42ac8a3efd9eae63
parent43b0d4f709a3a1446a32e36abb5deaa3bb45ddd9 (diff)
use std::vector::insert instead of push_back
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--basctl/source/basicide/basobj2.cxx14
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx5
-rw-r--r--cui/source/customize/SvxNotebookbarConfigPage.cxx9
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx7
-rw-r--r--dbaccess/source/core/api/TableDeco.cxx7
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx6
-rw-r--r--filter/source/msfilter/escherex.cxx9
-rw-r--r--forms/source/component/ComboBox.cxx3
-rw-r--r--forms/source/xforms/binding.cxx3
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx8
-rw-r--r--include/filter/msfilter/escherex.hxx2
-rw-r--r--sc/inc/rangelst.hxx2
-rw-r--r--sc/source/core/data/column3.cxx10
-rw-r--r--sc/source/core/data/documen5.cxx4
-rw-r--r--sc/source/core/data/dpdimsave.cxx4
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx3
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx3
-rw-r--r--sc/source/ui/view/drawvie4.cxx3
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx10
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx10
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx3
-rw-r--r--starmath/source/utility.cxx3
-rw-r--r--svx/source/dialog/imapdlg.cxx10
-rw-r--r--svx/source/dialog/imapwnd.cxx5
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx3
-rw-r--r--sw/source/filter/ww8/rtfstringbuffer.cxx3
-rw-r--r--tools/source/memtools/multisel.cxx6
-rw-r--r--ucb/source/ucp/file/filtask.cxx4
-rw-r--r--vcl/unx/generic/fontmanager/fontmanager.cxx5
-rw-r--r--xmloff/source/text/txtparae.cxx6
30 files changed, 51 insertions, 119 deletions
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 9748b24ccd2f..f14535cbd3f1 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -100,21 +100,15 @@ Sequence< OUString > GetMergedLibraryNames( const Reference< script::XLibraryCon
std::vector<OUString> aLibList;
if ( xModLibContainer.is() )
{
- Sequence< OUString > aModLibNames = xModLibContainer->getElementNames();
- sal_Int32 nModLibCount = aModLibNames.getLength();
- const OUString* pModLibNames = aModLibNames.getConstArray();
- for ( sal_Int32 i = 0 ; i < nModLibCount ; i++ )
- aLibList.push_back( pModLibNames[ i ] );
+ const Sequence< OUString > aModLibNames = xModLibContainer->getElementNames();
+ aLibList.insert( aLibList.end(), aModLibNames.begin(), aModLibNames.end() );
}
// create a list of dialog library names
if ( xDlgLibContainer.is() )
{
- Sequence< OUString > aDlgLibNames = xDlgLibContainer->getElementNames();
- sal_Int32 nDlgLibCount = aDlgLibNames.getLength();
- const OUString* pDlgLibNames = aDlgLibNames.getConstArray();
- for ( sal_Int32 i = 0 ; i < nDlgLibCount ; i++ )
- aLibList.push_back( pDlgLibNames[ i ] );
+ const Sequence< OUString > aDlgLibNames = xDlgLibContainer->getElementNames();
+ aLibList.insert( aLibList.end(), aDlgLibNames.begin(), aDlgLibNames.end() );
}
// sort list
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 1fde6881de12..e0ea8bc59aef 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -499,10 +499,7 @@ void OStatement_Base::GetAssignValues()
if (pOptColumnCommalist->count() == 0)
{
const Sequence< OUString>& aNames = m_xColNames->getElementNames();
- const OUString* pBegin = aNames.getConstArray();
- const OUString* pEnd = pBegin + aNames.getLength();
- for (; pBegin != pEnd; ++pBegin)
- aColumnNameList.push_back(*pBegin);
+ aColumnNameList.insert(aColumnNameList.end(), aNames.begin(), aNames.end());
}
else
{
diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx
index 16d555a9a2e7..43b792af8955 100644
--- a/cui/source/customize/SvxNotebookbarConfigPage.cxx
+++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx
@@ -423,20 +423,15 @@ void SvxNotebookbarConfigPage::SelectElement()
if (aEntries[nIdx].sClassId == "svtlo-ManagedMenuButton")
{
aTempEntries.push_back(aEntries[nIdx]);
- std::vector<NotebookbarEntries> aGtkEntries;
sal_Int32 rPos = 1;
sActiveCategory = aEntries[nIdx].sUIItemId.getToken(rPos, ':', rPos);
- FillFunctionsList(pNodePtr, aGtkEntries, aCategoryList, sActiveCategory);
- for (std::size_t Idx = 0; Idx < aGtkEntries.size(); Idx++)
- aTempEntries.push_back(aGtkEntries[Idx]);
- aGtkEntries.clear();
+ FillFunctionsList(pNodePtr, aTempEntries, aCategoryList, sActiveCategory);
}
else
aTempEntries.push_back(aEntries[nIdx]);
}
- aEntries = aTempEntries;
- aTempEntries.clear();
+ aEntries = std::move(aTempEntries);
weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
rTreeView.bulk_insert_for_each(
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 1d1c1429399a..118fb06cce00 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -335,12 +335,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void)
if( !aRemoveEntries[ i ] )
aRemainingVector.push_back( m_pTabPage->aFoundList[i] );
- m_pTabPage->aFoundList.clear();
-
- for( i = 0, nCount = aRemainingVector.size(); i < nCount; ++i )
- m_pTabPage->aFoundList.push_back( aRemainingVector[ i ] );
-
- aRemainingVector.clear();
+ m_pTabPage->aFoundList = std::move(aRemainingVector);
// refill list box
for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i )
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index 60cbce747e01..f40593b8598d 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -532,11 +532,8 @@ void ODBTableDecorator::refreshColumns()
xNames = m_xTable->getColumns();
if(xNames.is())
{
- Sequence< OUString> aNames = xNames->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
- for(;pIter != pEnd;++pIter)
- aVector.push_back(*pIter);
+ const Sequence< OUString> aNames = xNames->getElementNames();
+ aVector.insert(aVector.end(), aNames.begin(), aNames.end());
}
}
if(!m_pColumns)
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 92c03d54e17c..a005a33e7019 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2359,8 +2359,7 @@ namespace pcr
SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " PROPERTY_COMMANDTYPE);
const Sequence<OUString> aNames = ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection, nObjectType, sObjectName );
- for ( const OUString& rField : aNames )
- _rFieldNames.push_back( rField );
+ _rFieldNames.insert( _rFieldNames.end(), aNames.begin(), aNames.end() );
}
}
catch (const Exception&)
@@ -2491,8 +2490,7 @@ namespace pcr
return;
const Sequence<OUString> aNames = xTableNames->getElementNames();
- for ( const OUString& rTableName : aNames )
- _out_rNames.push_back( rTableName );
+ _out_rNames.insert( _out_rNames.end(), aNames.begin(), aNames.end() );
}
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 450aa4b6f208..fecb2fa45291 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -290,14 +290,9 @@ bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct&
return false;
}
-EscherProperties EscherPropertyContainer::GetOpts() const
+const EscherProperties & EscherPropertyContainer::GetOpts() const
{
- EscherProperties aVector;
-
- for ( size_t i = 0; i < pSortStruct.size(); ++i )
- aVector.push_back( pSortStruct[ i ] );
-
- return aVector;
+ return pSortStruct;
}
extern "C" {
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 9b1bd9b9c7bd..fe3260070d68 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -632,8 +632,7 @@ void OComboBoxModel::loadData( bool _bForce )
if (xFieldNames.is())
{
const Sequence<OUString> aFieldNames = xFieldNames->getElementNames();
- for (const OUString& rustrNames : aFieldNames)
- aStringList.push_back(rustrNames);
+ aStringList.insert(aStringList.end(), aFieldNames.begin(), aFieldNames.end());
}
}
break;
diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx
index 3b6983f05daf..6d8735f6366c 100644
--- a/forms/source/xforms/binding.cxx
+++ b/forms/source/xforms/binding.cxx
@@ -552,8 +552,7 @@ void Binding::bind( bool bForceRebind )
lcl_removeListenerFromNode( eventNode, this );
maEventNodes.clear();
if( isSimpleBinding() )
- for (auto const& node : aNodes)
- maEventNodes.push_back(node);
+ maEventNodes.insert(maEventNodes.end(), aNodes.begin(), aNodes.end());
else
maEventNodes.emplace_back( aContext.mxContextNode->getOwnerDocument(),
UNO_QUERY_THROW );
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index fb5525e295f9..877b4a9f6843 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -971,12 +971,8 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( bool bPreferred, const css:
xAccess->getByName(sKey) >>= xKey;
xKey->getByName(CFG_PROP_COMMAND) >>= xCommand;
- css::uno::Sequence< OUString > lLocales = xCommand->getElementNames();
- sal_Int32 nLocales = lLocales.getLength();
- ::std::vector< OUString > aLocales;
- aLocales.reserve(nLocales);
- for (sal_Int32 j = 0; j < nLocales; ++j)
- aLocales.push_back(lLocales[j]);
+ const css::uno::Sequence< OUString > lLocales = xCommand->getElementNames();
+ ::std::vector< OUString > aLocales { lLocales.begin(), lLocales.end() };
OUString sLocale;
for (auto const& locale : aLocales)
diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx
index a4625984308b..0246ce12e713 100644
--- a/include/filter/msfilter/escherex.hxx
+++ b/include/filter/msfilter/escherex.hxx
@@ -721,7 +721,7 @@ public:
bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
- EscherProperties GetOpts() const;
+ const EscherProperties & GetOpts() const;
void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index f35e4459c6ec..5489ab44b1b9 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -98,6 +98,8 @@ public:
::std::vector<ScRange>::const_iterator end() const { return maRanges.end(); }
::std::vector<ScRange>::iterator begin() { return maRanges.begin(); }
::std::vector<ScRange>::iterator end() { return maRanges.end(); }
+ void insert(std::vector<ScRange>::iterator aPos, std::vector<ScRange>::const_iterator aSourceBegin, std::vector<ScRange>::const_iterator aSourceEnd)
+ { maRanges.insert(aPos, aSourceBegin, aSourceEnd); }
void swap( ScRangeList& r );
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 79f001c12c91..9bbd9c1bca77 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -852,13 +852,9 @@ public:
if (!mbFormula)
return;
- sc::formula_block::iterator it = sc::formula_block::begin(*node.data);
- std::advance(it, nOffset);
- sc::formula_block::iterator itEnd = it;
- std::advance(itEnd, nDataSize);
-
- for (; it != itEnd; ++it)
- maFormulaCells.push_back(*it);
+ sc::formula_block::iterator it = sc::formula_block::begin(*node.data) + nOffset;
+ sc::formula_block::iterator itEnd = it + nDataSize;
+ maFormulaCells.insert(maFormulaCells.end(), it, itEnd);
}
break;
case sc::element_type_empty:
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 68bb7b4a7444..045f67f91424 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -286,9 +286,7 @@ void ScDocument::UpdateChartArea( const OUString& rChartName,
aNewRanges = new ScRangeList;
aNewRanges->Parse( aRangesStr, *this, GetAddressConvention());
-
- for ( size_t nAdd = 0, nAddCount = rNewList->size(); nAdd < nAddCount; ++nAdd )
- aNewRanges->push_back( (*rNewList)[nAdd] );
+ aNewRanges->insert( aNewRanges->begin(), rNewList->begin(), rNewList->end() );
}
else
{
diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx
index ccd940183ca7..c8ac79cc02ad 100644
--- a/sc/source/core/data/dpdimsave.cxx
+++ b/sc/source/core/data/dpdimsave.cxx
@@ -50,9 +50,7 @@ void ScDPSaveGroupItem::AddElement( const OUString& rName )
void ScDPSaveGroupItem::AddElementsFromGroup( const ScDPSaveGroupItem& rGroup )
{
// add all elements of the other group (used for nested grouping)
-
- for ( const auto& rElement : rGroup.aElements )
- aElements.push_back( rElement );
+ aElements.insert( aElements.end(), rGroup.aElements.begin(), rGroup.aElements.end() );
}
bool ScDPSaveGroupItem::RemoveElement( const OUString& rName )
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index e846d15a5b4c..4421c3222a17 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -339,8 +339,7 @@ static void addIfNotInMyMap( const StylesBuffer& rStyles, std::map< FormatKeyPai
{
// add ranges from the rangelist to the existing rangelist for the
// matching style ( should we check if they overlap ? )
- for (size_t i = 0, nSize = rRangeList.size(); i < nSize; ++i)
- it->second.push_back(rRangeList[i]);
+ it->second.insert(it->second.end(), rRangeList.begin(), rRangeList.end());
return;
}
rMap[ FormatKeyPair( nXfId, nFormatId ) ] = rRangeList;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 73f167b6e57e..30b41197dc55 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -9145,8 +9145,7 @@ const ScRangeList& ScUniqueFormatsEntry::GetRanges()
// fill and return ScRangeList
aReturnRanges = new ScRangeList;
- for ( const auto& rCompletedRange : aCompletedRanges )
- aReturnRanges->push_back( rCompletedRange );
+ aReturnRanges->insert( aReturnRanges->end(), aCompletedRanges.begin(), aCompletedRanges.end() );
aCompletedRanges.clear();
return *aReturnRanges;
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index cd1851d81082..2887f26811cd 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -250,8 +250,7 @@ void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneO
ScAddress aAddr;
if (aRange.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
{
- for(size_t i = 0; i < aRange.size(); ++i)
- pRanges->push_back(aRange[i]);
+ pRanges->insert(pRanges->end(), aRange.begin(), aRange.end());
}
else if (aAddr.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
pRanges->push_back(aAddr);
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index eb64897db853..002c1c5db4e6 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -155,8 +155,9 @@ bool SdPdfFilter::Import()
{
auto* pMarker = static_cast<vcl::pdf::PDFAnnotationMarkerInk*>(
rPDFAnnotation.mpMarker.get());
- for (auto const& rPolygon : pMarker->maStrokes)
- rCustomAnnotationMarker.maPolygons.push_back(rPolygon);
+ rCustomAnnotationMarker.maPolygons.insert(
+ rCustomAnnotationMarker.maPolygons.end(), pMarker->maStrokes.begin(),
+ pMarker->maStrokes.end());
rCustomAnnotationMarker.mnLineWidth = pMarker->mnWidth;
rCustomAnnotationMarker.maFillColor = pMarker->maFillColor;
}
@@ -166,8 +167,9 @@ bool SdPdfFilter::Import()
rCustomAnnotationMarker.maLineColor.SetAlpha(255 - 0x90);
auto* pMarker = static_cast<vcl::pdf::PDFAnnotationMarkerHighlight*>(
rPDFAnnotation.mpMarker.get());
- for (auto const& rPolygon : pMarker->maQuads)
- rCustomAnnotationMarker.maPolygons.push_back(rPolygon);
+ rCustomAnnotationMarker.maPolygons.insert(
+ rCustomAnnotationMarker.maPolygons.end(), pMarker->maQuads.begin(),
+ pMarker->maQuads.end());
rCustomAnnotationMarker.mnLineWidth = 1;
rCustomAnnotationMarker.maFillColor = rPDFAnnotation.maColor;
if (!rCustomAnnotationMarker.maFillColor.IsTransparent())
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 1cede475db43..7765793c8a13 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1350,14 +1350,6 @@ void FileDialogHelper_Impl::implStartExecute()
}
}
-static void lcl_saveLastURLs(std::vector<OUString>& rpURLList,
- ::std::vector< OUString >& lLastURLs )
-{
- lLastURLs.clear();
- for (auto const& url : rpURLList)
- lLastURLs.push_back(url);
-}
-
void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterface >& xPicker, std::vector<OUString>& rpURLList)
{
rpURLList.clear();
@@ -1397,7 +1389,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac
}
}
- lcl_saveLastURLs(rpURLList, mlLastURLs);
+ mlLastURLs = rpURLList;
}
ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList,
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 4809cc4dc83f..83607ddd7aaf 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -820,8 +820,7 @@ void SlideImpl::drawPolygons() const
void SlideImpl::addPolygons(const PolyPolygonVector& rPolygons)
{
- for (const auto& rxPolygon : rPolygons)
- maPolygons.push_back(rxPolygon);
+ maPolygons.insert(maPolygons.end(), rPolygons.begin(), rPolygons.end());
}
bool SlideImpl::isPaintOverlayActive() const
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 7012004bea94..eab123d7829a 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -45,8 +45,7 @@ SmFontPickList& SmFontPickList::operator = (const SmFontPickList& rList)
{
Clear();
nMaxItems = rList.nMaxItems;
- for (const auto & nPos : rList.aFontVec)
- aFontVec.push_back( nPos );
+ aFontVec = rList.aFontVec;
return *this;
}
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index fb8252d76eba..9e499493acc7 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -253,18 +253,14 @@ void SvxIMapDlg::UpdateLink( const Graphic& rGraphic, const ImageMap* pImageMap,
// Delete UpdateTargetList, because this method can still be called several
// times before the update timer is turned on
- pOwnData->aUpdateTargetList.clear();
// TargetList must be copied, since it is owned by the caller and can be
// deleted immediately after this call the copied list will be deleted
// again in the handler
if( pTargetList )
- {
- TargetList aTargetList( *pTargetList );
-
- for (const OUString & s : aTargetList)
- pOwnData->aUpdateTargetList.push_back( s );
- }
+ pOwnData->aUpdateTargetList = *pTargetList;
+ else
+ pOwnData->aUpdateTargetList.clear();
pOwnData->aIdle.Start();
}
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index a4ed0e6090a9..d6f212f0c8e0 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -164,11 +164,8 @@ const ImageMap& IMapWindow::GetImageMap()
void IMapWindow::SetTargetList( const TargetList& rTargetList )
{
// Delete old List
- aTargetList.clear();
-
// Fill with the provided list
- for(const OUString & s : rTargetList)
- aTargetList.push_back( s );
+ aTargetList = rTargetList;
pModel->SetChanged( false );
}
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 98b7b9401800..ef44f23ca57f 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -550,8 +550,7 @@ void SwDoc::SetRowNotTracked( const SwCursor& rCursor, const SvxPrintItem &rNew,
if ( bAll )
{
const SwTableLines &rLines = pTableNd->GetTable().GetTabLines();
- for ( auto pLine : rLines )
- aRowArr.push_back(pLine);
+ aRowArr.insert(aRowArr.end(), rLines.begin(), rLines.end());
}
else
::lcl_CollectLines( aRowArr, rCursor, true );
diff --git a/sw/source/filter/ww8/rtfstringbuffer.cxx b/sw/source/filter/ww8/rtfstringbuffer.cxx
index f5d21d0b2bd4..e6b215a143cd 100644
--- a/sw/source/filter/ww8/rtfstringbuffer.cxx
+++ b/sw/source/filter/ww8/rtfstringbuffer.cxx
@@ -78,8 +78,7 @@ void RtfStringBuffer::append(const SwFlyFrameFormat* pFlyFrameFormat, const SwGr
void RtfStringBuffer::appendAndClear(RtfStringBuffer& rBuf)
{
- for (const auto& rValue : rBuf.m_aValues)
- m_aValues.push_back(rValue);
+ m_aValues.insert(m_aValues.end(), rBuf.m_aValues.begin(), rBuf.m_aValues.end());
rBuf.clear();
}
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index faa78f78144a..1f3f8eb5a23a 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -88,8 +88,7 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig ) :
}
// copy the sub selections
- for (const Range & rSel : rOrig.aSels)
- aSels.push_back( rSel );
+ aSels.insert( aSels.end(), rOrig.aSels.begin(), rOrig.aSels.end() );
}
MultiSelection::MultiSelection( const Range& rRange ):
@@ -117,8 +116,7 @@ MultiSelection& MultiSelection::operator= ( const MultiSelection& rOrig )
// clear the old and copy the sub selections
ImplClear();
- for (const Range& rSel : rOrig.aSels)
- aSels.push_back( rSel );
+ aSels.insert( aSels.end(), rOrig.aSels.begin(), rOrig.aSels.end() );
nSelCount = rOrig.nSelCount;
return *this;
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 6c900d33f6a8..6f465dab57ba 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2722,8 +2722,8 @@ TaskManager::getContentExchangedEventListeners( const OUString& aOldPrefix,
// Merge with preexisting notifiers
// However, these may be in status BaseContent::Deleted
- for( const auto& rCopyPtr : copyList )
- itnew->second.notifier.push_back( rCopyPtr );
+ itnew->second.notifier.insert(itnew->second.notifier.end(),
+ copyList.begin(), copyList.end() );
}
}
}
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 4262368d1fe8..86b5b1b435e3 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -759,10 +759,7 @@ void PrintFontManager::fillPrintFontInfo(const PrintFont& rFont, FastPrintFontIn
rInfo.m_eWeight = rFont.m_eWeight;
rInfo.m_ePitch = rFont.m_ePitch;
rInfo.m_aEncoding = rFont.m_aEncoding;
-
- rInfo.m_aAliases.clear();
- for (auto const& aAlias : rFont.m_aAliases)
- rInfo.m_aAliases.push_back(aAlias);
+ rInfo.m_aAliases = rFont.m_aAliases;
}
void PrintFontManager::fillPrintFontInfo( PrintFont& rFont, PrintFontInfo& rInfo ) const
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 7257ac0061af..b444635af77e 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -537,8 +537,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily,
vector< XMLPropertyState > aPropStates =
xPropMapper->Filter(GetExport(), rPropSet);
- for (const XMLPropertyState& rState : aAddStates)
- aPropStates.push_back( rState );
+ aPropStates.insert( aPropStates.end(), aAddStates.begin(), aAddStates.end() );
if( aPropStates.empty() )
return;
@@ -759,8 +758,7 @@ OUString XMLTextParagraphExport::Find(
if( !xPropMapper.is() )
return sName;
vector<XMLPropertyState> aPropStates(xPropMapper->Filter(GetExport(), rPropSet));
- for (const XMLPropertyState& rState : aAddStates)
- aPropStates.push_back( rState );
+ aPropStates.insert( aPropStates.end(), aAddStates.begin(), aAddStates.end() );
if( std::any_of( aPropStates.begin(), aPropStates.end(), lcl_validPropState ) )
sName = GetAutoStylePool().Find( nFamily, sName, aPropStates );