diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-23 15:02:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-24 08:43:55 +0200 |
commit | a2fc883173d7053cefe543620982051ae40c4b03 (patch) | |
tree | dac1b760925c8151dfd8a9cbe3a8735b68ab9f79 | |
parent | 010713e65ccade7b682c219707c8db3d864145c1 (diff) |
use more std::container::insert instead of std::copy
which is both more compact code, and more efficient, since the insert
method can do smarter resizing
Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
52 files changed, 85 insertions, 192 deletions
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index cedadda510cf..d557bd5f31f4 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -1228,9 +1228,7 @@ namespace basctl OUString aBaseName = _eType == E_SCRIPTS ? OUString("Module") : OUString("Dialog"); Sequence< OUString > aUsedNames( getObjectNames( _eType, _rLibName ) ); - std::set< OUString > aUsedNamesCheck; - std::copy( aUsedNames.begin(), aUsedNames.end(), - std::insert_iterator< std::set< OUString > >( aUsedNamesCheck, aUsedNamesCheck.begin() ) ); + std::set< OUString > aUsedNamesCheck( aUsedNames.begin(), aUsedNames.end() ); bool bValid = false; sal_Int32 i = 1; diff --git a/basegfx/source/tools/keystoplerp.cxx b/basegfx/source/tools/keystoplerp.cxx index 725d52cf431a..0610dd19c228 100644 --- a/basegfx/source/tools/keystoplerp.cxx +++ b/basegfx/source/tools/keystoplerp.cxx @@ -50,10 +50,9 @@ namespace basegfx::utils } KeyStopLerp::KeyStopLerp( const ::css::uno::Sequence<double>& rKeyStops ) : - maKeyStops(rKeyStops.getLength()), + maKeyStops(rKeyStops.begin(), rKeyStops.end()), mnLastIndex(0) { - std::copy( rKeyStops.begin(), rKeyStops.end(), maKeyStops.begin() ); validateInput(maKeyStops); } diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index 6a1d935c9ba9..57b0875c3f4e 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -281,11 +281,9 @@ namespace oglcanvas mpSpriteCanvas->renderRecordedActions(); // render all sprites (in order of priority) on top of that - std::vector< ::rtl::Reference<CanvasCustomSprite> > aSprites; - std::copy(maActiveSprites.begin(), - maActiveSprites.end(), - std::back_insert_iterator< - std::vector< ::rtl::Reference< CanvasCustomSprite > > >(aSprites)); + std::vector< ::rtl::Reference<CanvasCustomSprite> > aSprites( + maActiveSprites.begin(), + maActiveSprites.end()); std::sort(aSprites.begin(), aSprites.end(), SpriteComparator()); diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx index c1595f459940..443673093ff1 100644 --- a/canvas/source/tools/spriteredrawmanager.cxx +++ b/canvas/source/tools/spriteredrawmanager.cxx @@ -234,10 +234,7 @@ namespace canvas } // sort sprites after prio - VectorOfSprites aSortedSpriteVector; - std::copy( maSprites.begin(), - maSprites.end(), - std::back_insert_iterator< VectorOfSprites >(aSortedSpriteVector) ); + VectorOfSprites aSortedSpriteVector( maSprites.begin(), maSprites.end() ); std::sort( aSortedSpriteVector.begin(), aSortedSpriteVector.end(), aSpriteComparator ); diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index c90a356bf2ee..11f6bf2d94b3 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -244,8 +244,7 @@ getAllDataSequences( const uno::Sequence<uno::Reference<chart2::XDataSeries> >& if( xSource.is()) { Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( xSource->getDataSequences()); - std::copy( aSeq.begin(), aSeq.end(), - std::back_inserter( aSeqVec )); + aSeqVec.insert( aSeqVec.end(), aSeq.begin(), aSeq.end() ); } } diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx index 50fd37347f09..cb74e60eaa54 100644 --- a/chart2/source/tools/DataSourceHelper.cxx +++ b/chart2/source/tools/DataSourceHelper.cxx @@ -310,8 +310,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData( if( !xDataSource.is() ) continue; uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() ); - std::copy( aDataSequences.begin(), aDataSequences.end(), - std::back_inserter( aResult )); + aResult.insert( aResult.end(), aDataSequences.begin(), aDataSequences.end() ); } return uno::Reference< chart2::data::XDataSource >( @@ -335,8 +334,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData( if( !xDataSource.is() ) continue; uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() ); - std::copy( aDataSequences.begin(), aDataSequences.end(), - std::back_inserter( aResult )); + aResult.insert( aResult.end(), aDataSequences.begin(), aDataSequences.end() ); } return uno::Reference< chart2::data::XDataSource >( diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 213d1787d1ce..5805f929aebb 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -670,8 +670,7 @@ std::vector< Reference< XDataSeries > > { Reference< XDataSeriesContainer > xDSCnt( chartType, uno::UNO_QUERY_THROW ); Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() ); - std::copy( aSeriesSeq.begin(), aSeriesSeq.end(), - std::back_inserter( aResult )); + aResult.insert( aResult.end(), aSeriesSeq.begin(), aSeriesSeq.end() ); } } } @@ -1202,8 +1201,7 @@ Sequence< Reference< XChartType > > { Reference< XChartTypeContainer > xCTCnt( coords, uno::UNO_QUERY_THROW ); Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes()); - std::copy( aChartTypeSeq.begin(), aChartTypeSeq.end(), - std::back_inserter( aResult )); + aResult.insert( aResult.end(), aChartTypeSeq.begin(), aChartTypeSeq.end() ); } } catch( const uno::Exception & ) diff --git a/chart2/source/tools/ImplOPropertySet.cxx b/chart2/source/tools/ImplOPropertySet.cxx index d5f30096e49e..7d09a329fc33 100644 --- a/chart2/source/tools/ImplOPropertySet.cxx +++ b/chart2/source/tools/ImplOPropertySet.cxx @@ -92,8 +92,7 @@ ImplOPropertySet::ImplOPropertySet() ImplOPropertySet::ImplOPropertySet( const ImplOPropertySet & rOther ) { - std::copy( rOther.m_aProperties.begin(), rOther.m_aProperties.end(), - std::inserter( m_aProperties, m_aProperties.begin() )); + m_aProperties = rOther.m_aProperties; // clone interface properties std::for_each( m_aProperties.begin(), m_aProperties.end(), diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 7c826e8f6129..ff89bc6dee92 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -456,9 +456,7 @@ void InternalDataProvider::adaptMapReferences( // erase map values for old index m_aSequenceMap.erase( aRange.first, aRange.second ); // add new entries for values with new index - std::copy( aNewElements.begin(), aNewElements.end(), - std::inserter( m_aSequenceMap, - m_aSequenceMap.upper_bound( rNewRangeRepresentation ))); + m_aSequenceMap.insert( aNewElements.begin(), aNewElements.end() ); } void InternalDataProvider::increaseMapReferences( diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 1018413befb6..5f5a1289ba31 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -84,22 +84,14 @@ namespace comphelper && (_rArguments[1] >>= AllowEmptyPropertyName) && (_rArguments[2] >>= AutomaticAddition)) { - std::copy( - aTypes.begin(), - aTypes.end(), - std::insert_iterator< TypeBag >( m_aAllowedTypes, m_aAllowedTypes.begin() ) - ); + m_aAllowedTypes.insert(aTypes.begin(), aTypes.end()); m_bAutoAddProperties = AutomaticAddition; } else { ::comphelper::NamedValueCollection aArguments( _rArguments ); if ( aArguments.get_ensureType( "AllowedTypes", aTypes ) ) - std::copy( - aTypes.begin(), - aTypes.end(), - std::insert_iterator< TypeBag >( m_aAllowedTypes, m_aAllowedTypes.begin() ) - ); + m_aAllowedTypes.insert( aTypes.begin(), aTypes.end()); aArguments.get_ensureType( "AutomaticAddition", m_bAutoAddProperties ); aArguments.get_ensureType( "AllowEmptyPropertyName", diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 419cd26e7c07..7f2e418601e9 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1388,12 +1388,7 @@ sal_Int32 getSearchColumnFlag( const Reference< XConnection>& _rxConn,sal_Int32 OUString createUniqueName( const Sequence< OUString >& _rNames, const OUString& _rBaseName, bool _bStartWithNumber ) { - std::set< OUString > aUsedNames; - std::copy( - _rNames.begin(), - _rNames.end(), - std::insert_iterator< std::set< OUString > >( aUsedNames, aUsedNames.end() ) - ); + std::set< OUString > aUsedNames(_rNames.begin(), _rNames.end()); OUString sName( _rBaseName ); sal_Int32 nPos = 1; diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index d8c48c64321a..a91390eca2b8 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -345,8 +345,7 @@ void OSQLParseTreeIterator::impl_getQueryParameterColumns( const OSQLTable& _rQu } while ( false ); // copy the parameters of the sub query to our own parameter array - std::copy( pSubQueryParameterColumns->begin(), pSubQueryParameterColumns->end(), - std::back_inserter( *m_aParameters ) ); + m_aParameters->insert( m_aParameters->end(), pSubQueryParameterColumns->begin(), pSubQueryParameterColumns->end() ); } diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 7b45afa8652e..a9c39e408b52 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -325,14 +325,6 @@ void SvxMacroTabPage_::DisplayAppEvents( bool appEvents) if(!nameReplace.is()) return; - Sequence< OUString > eventNames = nameReplace->getElementNames(); - std::set< OUString > aEventNamesCache; - std::copy( - eventNames.begin(), - eventNames.end(), - std::insert_iterator< std::set< OUString > >( aEventNamesCache, aEventNamesCache.end() ) - ); - for (auto const& displayableEvent : aDisplayNames) { OUString sEventName( OUString::createFromAscii( displayableEvent.pAsciiEventName ) ); diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 64d84729c6e3..13b68d9f15bc 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -1215,7 +1215,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) } if ( XmlStyleFamily::TABLE_CELL == i.second.second ) - std::copy( m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end(), std::back_inserter( aPropStates )); + aPropStates.insert( aPropStates.end(), m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end() ); if ( !aPropStates.empty() ) i.second.first->emplace( _xProp,GetAutoStylePool()->Add( i.second.second, aPropStates ) ); } diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 98d622584494..6b0a17d05446 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -177,14 +177,10 @@ void OApplicationController::deleteObjects( ElementType _eType, const std::vecto // be the ancestor or child of another element from the list. // We want to ensure that ancestors get deleted first, so we normalize the list in this respect. // #i33353# - std::set< OUString > aDeleteNames; - // Note that this implicitly uses std::less< OUString > a comparison operation, which - // results in lexicographical order, which is exactly what we need, because "foo" is *before* - // any "foo/bar" in this order. - std::copy( - _rList.begin(), _rList.end(), - std::insert_iterator< std::set< OUString > >( aDeleteNames, aDeleteNames.begin() ) - ); + // Note that this implicitly uses std::less< OUString > a comparison operation, which + // results in lexicographical order, which is exactly what we need, because "foo" is *before* + // any "foo/bar" in this order. + std::set< OUString > aDeleteNames(_rList.begin(), _rList.end()); std::set< OUString >::size_type nCount = aDeleteNames.size(); for ( std::set< OUString >::size_type nObjectsLeft = nCount; !aDeleteNames.empty(); ) diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 21a7c9e8bf96..a5229aebf230 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -423,7 +423,7 @@ void ORelationController::mergeData(const TTableConnectionData& _aConnectionData { ::osl::MutexGuard aGuard( getMutex() ); - std::copy( _aConnectionData.begin(), _aConnectionData.end(), std::back_inserter( m_vTableConnectionData )); + m_vTableConnectionData.insert( m_vTableConnectionData.end(), _aConnectionData.begin(), _aConnectionData.end() ); // here we are finished, so we can collect the table from connection data for (auto const& elem : m_vTableConnectionData) { diff --git a/drawinglayer/source/primitive2d/Primitive2DContainer.cxx b/drawinglayer/source/primitive2d/Primitive2DContainer.cxx index 8f1e7d31e743..3df6dd791528 100644 --- a/drawinglayer/source/primitive2d/Primitive2DContainer.cxx +++ b/drawinglayer/source/primitive2d/Primitive2DContainer.cxx @@ -111,17 +111,13 @@ void Primitive2DContainer::append(const Primitive2DContainer& rSource) void Primitive2DContainer::append(Primitive2DContainer&& rSource) { - size_t n = size(); - resize(n + rSource.size()); - for (size_t i = 0; i < rSource.size(); ++i) - { - (*this)[n + i] = std::move(rSource[i]); - } + this->insert(this->end(), std::make_move_iterator(rSource.begin()), + std::make_move_iterator(rSource.end())); } void Primitive2DContainer::append(const Primitive2DSequence& rSource) { - std::copy(rSource.begin(), rSource.end(), std::back_inserter(*this)); + this->insert(this->end(), rSource.begin(), rSource.end()); } } // end of namespace drawinglayer::primitive2d diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 32d9894dace4..9e36427cecdc 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -933,7 +933,7 @@ namespace pcr } // now that they're disambiguated, copy these types into our member - std::copy(aListeners.begin(), aListeners.end(), std::back_inserter(_out_rTypes)); + _out_rTypes.insert( _out_rTypes.end(), aListeners.begin(), aListeners.end() ); } catch( const Exception& ) { diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index fabc5fb5d1aa..b6b9dafb7f95 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -3391,9 +3391,7 @@ void AutoRecovery::implts_openOneDoc(const OUString& sURL , } // re-create all the views - ::std::vector< OUString > aViewsToRestore( rInfo.ViewNames.getLength() ); - if ( rInfo.ViewNames.hasElements() ) - ::std::copy( rInfo.ViewNames.begin(), rInfo.ViewNames.end(), aViewsToRestore.begin() ); + ::std::vector< OUString > aViewsToRestore( rInfo.ViewNames.begin(), rInfo.ViewNames.end() ); // if we don't have views for whatever reason, then create a default-view, at least if ( aViewsToRestore.empty() ) aViewsToRestore.emplace_back( ); diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 600a42be6137..60ba0e0d2cf5 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -454,7 +454,7 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions( const Sequence< OUString > aNewConv( xDic->getConversions( rText, nStartPos, nLength, eDirection, nTextConversionOptions ) ); - std::copy(aNewConv.begin(), aNewConv.end(), std::back_inserter(aRes)); + aRes.insert( aRes.end(), aNewConv.begin(), aNewConv.end() ); } } diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 6511cfaac48c..e1ff4e7f763c 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -354,8 +354,7 @@ static void lcl_fillCategoriesIntoStringVector( { rOutCategories.clear(); Sequence< OUString > aTextData( xTextualDataSequence->getTextualData()); - ::std::copy( aTextData.begin(), aTextData.end(), - ::std::back_inserter( rOutCategories )); + rOutCategories.insert( rOutCategories.end(), aTextData.begin(), aTextData.end() ); } else { @@ -376,8 +375,7 @@ static ::std::vector< double > lcl_getAllValuesFromSequence( const Reference< ch if( xNumSeq.is()) { Sequence< double > aValues( xNumSeq->getNumericalData()); - ::std::copy( aValues.begin(), aValues.end(), - ::std::back_inserter( aResult )); + aResult.insert( aResult.end(), aValues.begin(), aValues.end() ); } else if( xSeq.is()) { diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index d8c1de39315c..e82298de458b 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -554,7 +554,7 @@ public: sal_Int32 nBytes = xSrcStream->readBytes(aBuf, nReadSize); const sal_Int8* p = aBuf.getArray(); const sal_Int8* pEnd = p + nBytes; - std::copy(p, pEnd, std::back_inserter(maBytes)); + maBytes.insert( maBytes.end(), p, pEnd ); return nBytes; }; diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index a56333bc7775..fa04c4baa46c 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1210,7 +1210,7 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted } ::std::vector< XMLPropertyState > aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(xBorderProp)); - ::std::copy(aBorderStates.begin(),aBorderStates.end(),::std::back_inserter(aPropertyStates)); + aPropertyStates.insert( aPropertyStates.end(), aBorderStates.begin(), aBorderStates.end() ); } else { diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index efcf66894a10..50fe4e8bb85d 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -1373,7 +1373,7 @@ void ScTable::SortReorderByRowRefUpdate( FormulaCellCollectAction aAction(aFCells); aGrpListenerRanges.executeColumnAction(*pDocument, aAction); - std::copy(aFCells.begin(), aFCells.end(), std::back_inserter(aListeners)); + aListeners.insert( aListeners.end(), aFCells.begin(), aFCells.end() ); } // Remove any duplicate listener entries. We must ensure that we notify diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx index dabe9a1a06dd..4f38a59a3e69 100644 --- a/sc/source/ui/vba/vbachartobjects.cxx +++ b/sc/source/ui/vba/vbachartobjects.cxx @@ -116,7 +116,7 @@ ScVbaChartObjects::getChartObjectNames() const { uno::Reference< table::XTableChartsSupplier > xLocTableChartsSupplier( xSpreadsheets->getByName(rSheetName), uno::UNO_QUERY_THROW ); const uno::Sequence< OUString > scurchartnames = xLocTableChartsSupplier->getCharts()->getElementNames(); - std::copy(scurchartnames.begin(), scurchartnames.end(), std::back_inserter(aChartNamesVector)); + aChartNamesVector.insert( aChartNamesVector.end(), scurchartnames.begin(), scurchartnames.end() ); } sChartNames = comphelper::containerToSequence( aChartNamesVector ); } diff --git a/sccomp/source/solver/ParticelSwarmOptimization.hxx b/sccomp/source/solver/ParticelSwarmOptimization.hxx index ec76474ddece..42782cfa5b69 100644 --- a/sccomp/source/solver/ParticelSwarmOptimization.hxx +++ b/sccomp/source/solver/ParticelSwarmOptimization.hxx @@ -113,15 +113,15 @@ public: rParticle.mPosition[k] = mrDataProvider.clampVariable(k, rParticle.mPosition[k]); } - std::copy(rParticle.mPosition.begin(), rParticle.mPosition.end(), - rParticle.mBestPosition.begin()); + rParticle.mBestPosition.insert(rParticle.mBestPosition.begin(), + rParticle.mPosition.begin(), rParticle.mPosition.end()); rParticle.mBestFitness = rParticle.mCurrentFitness; if (rParticle.mCurrentFitness > mfBestFitness) { mfBestFitness = rParticle.mCurrentFitness; - std::copy(rParticle.mPosition.begin(), rParticle.mPosition.end(), - maBestPosition.begin()); + maBestPosition.insert(maBestPosition.begin(), rParticle.mPosition.begin(), + rParticle.mPosition.end()); } } } @@ -153,8 +153,9 @@ public: if (rParticle.mCurrentFitness > rParticle.mBestFitness) { rParticle.mBestFitness = rParticle.mCurrentFitness; - std::copy(rParticle.mPosition.begin(), rParticle.mPosition.end(), - rParticle.mBestPosition.begin()); + rParticle.mBestPosition.insert(rParticle.mBestPosition.begin(), + rParticle.mPosition.begin(), + rParticle.mPosition.end()); } if (rParticle.mCurrentFitness > mfBestFitness) @@ -164,8 +165,8 @@ public: bBestChanged = true; mnLastChange = mnGeneration; } - std::copy(rParticle.mPosition.begin(), rParticle.mPosition.end(), - maBestPosition.begin()); + maBestPosition.insert(maBestPosition.begin(), rParticle.mPosition.begin(), + rParticle.mPosition.end()); mfBestFitness = rParticle.mCurrentFitness; } } diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index d6567fc9f38d..ca84ab88285a 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -2818,8 +2818,7 @@ void EffectSequenceHelper::setTextReverse( const CustomAnimationTextGroupPtr& pT } else { - std::vector< CustomAnimationEffectPtr > aSortedVector(pTextGroup->maEffects.size()); - std::copy( pTextGroup->maEffects.begin(), pTextGroup->maEffects.end(), aSortedVector.begin() ); + std::vector< CustomAnimationEffectPtr > aSortedVector( pTextGroup->maEffects.begin(), pTextGroup->maEffects.end() ); ImplStlTextGroupSortHelper aSortHelper( bTextReverse ); std::sort( aSortedVector.begin(), aSortedVector.end(), aSortHelper ); diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 9a21767141c0..e5ed520d9895 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -1143,7 +1143,7 @@ void EffectMigration::SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos if( nNewPos == static_cast<sal_Int32>(aEffectVector.size()) ) { - std::copy(aEffects.begin(), aEffects.end(), std::back_inserter(rSequence)); + rSequence.insert( rSequence.end(), aEffects.begin(), aEffects.end() ); } else { diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 45e44c0d8628..0b81244ff811 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -2220,8 +2220,8 @@ sal_Int32 CustomAnimationPane::fillAnimationLB( bool bHasText ) int nPos = mxLBAnimation->n_children(); - std::vector< CustomAnimationPresetPtr > aSortedVector(pCategory->maEffects.size()); - std::copy( pCategory->maEffects.begin(), pCategory->maEffects.end(), aSortedVector.begin() ); + std::vector< CustomAnimationPresetPtr > aSortedVector = + pCategory->maEffects; for( CustomAnimationPresetPtr& pDescriptor : aSortedVector ) { diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx b/sd/source/ui/framework/configuration/ResourceId.cxx index bcc351b4a1b3..e851e2a260dc 100644 --- a/sd/source/ui/framework/configuration/ResourceId.cxx +++ b/sd/source/ui/framework/configuration/ResourceId.cxx @@ -373,7 +373,7 @@ void SAL_CALL ResourceId::initialize (const Sequence<Any>& aArguments) { maResourceURLs.push_back(xAnchor->getResourceURL()); Sequence<OUString> aAnchorURLs (xAnchor->getAnchorURLs()); - std::copy(aAnchorURLs.begin(), aAnchorURLs.end(), std::back_inserter(maResourceURLs)); + maResourceURLs.insert( maResourceURLs.end(), aAnchorURLs.begin(), aAnchorURLs.end() ); } } } diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index b8ea8b70bfcb..e540c2cc83a7 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -1245,10 +1245,9 @@ void ToolBarList::MakeRequestedToolBarList (std::vector<OUString>& rRequestedToo { Groups::const_iterator iGroup (maGroups.find(eGroup)); if (iGroup != maGroups.end()) - ::std::copy( + rRequestedToolBars.insert( rRequestedToolBars.end(), iGroup->second.begin(), - iGroup->second.end(), - ::std::inserter(rRequestedToolBars,rRequestedToolBars.end())); + iGroup->second.end() ); } } diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 356b3751c2e2..cc35b54c835d 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -556,17 +556,14 @@ void PresenterClockTimer::CheckCurrentTime (const TimeValue& rCurrentTime) void SAL_CALL PresenterClockTimer::notify (const css::uno::Any&) { - ListenerContainer aListenerCopy (maListeners); + ListenerContainer aListenerCopy; { osl::MutexGuard aGuard (maMutex); mbIsCallbackPending = false; - ::std::copy( - maListeners.begin(), - maListeners.end(), - ::std::back_inserter(aListenerCopy)); + aListenerCopy = maListeners; } for (const auto& rxListener : aListenerCopy) diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx index 69e1a197d4ee..56af57524a88 100644 --- a/sfx2/source/control/charmapcontrol.cxx +++ b/sfx2/source/control/charmapcontrol.cxx @@ -117,11 +117,11 @@ void SfxCharmapCtrl::getFavCharacterList() { //retrieve recent character list css::uno::Sequence< OUString > rFavCharList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::get() ); - std::copy(rFavCharList.begin(), rFavCharList.end(), std::back_inserter(m_aFavCharList)); + m_aFavCharList.insert( m_aFavCharList.end(), rFavCharList.begin(), rFavCharList.end() ); //retrieve recent character font list css::uno::Sequence< OUString > rFavCharFontList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::get() ); - std::copy(rFavCharFontList.begin(), rFavCharFontList.end(), std::back_inserter(m_aFavCharFontList)); + m_aFavCharFontList.insert( m_aFavCharFontList.end(), rFavCharFontList.begin(), rFavCharFontList.end() ); } void SfxCharmapCtrl::updateFavCharControl() @@ -149,11 +149,11 @@ void SfxCharmapCtrl::getRecentCharacterList() { //retrieve recent character list css::uno::Sequence< OUString > rRecentCharList( officecfg::Office::Common::RecentCharacters::RecentCharacterList::get() ); - std::copy(rRecentCharList.begin(), rRecentCharList.end(), std::back_inserter(m_aRecentCharList)); + m_aRecentCharList.insert( m_aRecentCharList.end(), rRecentCharList.begin(), rRecentCharList.end() ); //retrieve recent character font list css::uno::Sequence< OUString > rRecentCharFontList( officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::get() ); - std::copy(rRecentCharFontList.begin(), rRecentCharFontList.end(), std::back_inserter(m_aRecentCharFontList)); + m_aRecentCharFontList.insert( m_aRecentCharFontList.end(), rRecentCharFontList.begin(), rRecentCharFontList.end() ); } void SfxCharmapCtrl::updateRecentCharControl() diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index 2ec37ee2c6ff..a69f42d31372 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -722,8 +722,7 @@ namespace slideshow::internal // to avoid tons of temporaries, create weak_ptr to Layers // beforehand - std::vector< LayerWeakPtr > aWeakLayers(maLayers.size()); - std::copy(maLayers.begin(),maLayers.end(),aWeakLayers.begin()); + std::vector< LayerWeakPtr > aWeakLayers(maLayers.begin(),maLayers.end()); std::size_t nCurrLayerIndex(0); bool bIsBackgroundLayer(true); diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx index 09604631051b..73020ef60f2a 100644 --- a/svl/source/passwordcontainer/syscreds.cxx +++ b/svl/source/passwordcontainer/syscreds.cxx @@ -172,9 +172,7 @@ void SysCredentialsConfig::initCfg() { uno::Sequence< OUString > aURLs( m_aConfigItem.getSystemCredentialsURLs() ); - std::copy(aURLs.begin(), aURLs.end(), - std::inserter(m_aCfgContainer, m_aCfgContainer.end())); - + m_aCfgContainer.insert( aURLs.begin(), aURLs.end() ); m_bCfgInited = true; } } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 4b496ddb0cc6..3a1d079b785c 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -288,8 +288,7 @@ void AssignmentPersistentData::ImplCommit() :ConfigItem("Office.DataAccess/AddressBook") { Sequence< OUString > aStoredNames = GetNodeNames("Fields"); - std::copy(aStoredNames.begin(), aStoredNames.end(), - std::inserter(m_aStoredFields, m_aStoredFields.end())); + m_aStoredFields.insert(aStoredNames.begin(), aStoredNames.end()); } bool AssignmentPersistentData::hasFieldAssignment(const OUString& _rLogicalName) @@ -846,8 +845,7 @@ void AssignmentPersistentData::ImplCommit() // for quicker access - ::std::set< OUString > aColumnNameSet; - std::copy(aColumnNames.begin(), aColumnNames.end(), std::inserter(aColumnNameSet, aColumnNameSet.end())); + ::std::set< OUString > aColumnNameSet(aColumnNames.begin(), aColumnNames.end()); std::vector<OUString>::iterator aInitialSelection = m_pImpl->aFieldAssignments.begin() + m_pImpl->nFieldScrollPos; diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 3ffa410e8fc6..1b4c497ec65e 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -808,12 +808,7 @@ void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatu if ( m_pShell->GetViewShell() && m_pShell->GetViewShell()->GetViewFrame() ) { // unfortunately, SFX requires sal_uInt16 - ::std::vector< sal_uInt16 > aSlotIds; - aSlotIds.reserve( _rFeatures.size() ); - ::std::copy( _rFeatures.begin(), - _rFeatures.end(), - ::std::insert_iterator< ::std::vector< sal_uInt16 > >( aSlotIds, aSlotIds.begin() ) - ); + ::std::vector< sal_uInt16 > aSlotIds( _rFeatures.begin(), _rFeatures.end() ); // furthermore, SFX wants a terminating 0 aSlotIds.push_back( 0 ); diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index be6e956cc478..a292f702f8ff 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3984,9 +3984,7 @@ void SAL_CALL FormController::invalidateFeatures( const Sequence< ::sal_Int16 >& { ::osl::MutexGuard aGuard( m_aMutex ); // for now, just copy the ids of the features, because... - ::std::copy( Features.begin(), Features.end(), - ::std::insert_iterator< ::std::set< sal_Int16 > >( m_aInvalidFeatures, m_aInvalidFeatures.begin() ) - ); + m_aInvalidFeatures.insert( Features.begin(), Features.end() ); // ... we will do the real invalidation asynchronously if ( !m_aFeatureInvalidationTimer.IsActive() ) diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index 7fffd84617da..c18a0f6c373b 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -424,8 +424,7 @@ namespace svx SID_FM_VIEW_AS_GRID }; sal_Int32 nFeatureCount = SAL_N_ELEMENTS( pSupportedFeatures ); - aSupportedFeatures.resize( nFeatureCount ); - ::std::copy( pSupportedFeatures, pSupportedFeatures + nFeatureCount, aSupportedFeatures.begin() ); + aSupportedFeatures.insert( aSupportedFeatures.begin(), pSupportedFeatures, pSupportedFeatures + nFeatureCount ); m_pInvalidationCallback->invalidateFeatures( aSupportedFeatures ); } diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx index 19bd4d576959..887633412248 100644 --- a/sw/source/core/access/textmarkuphelper.cxx +++ b/sw/source/core/access/textmarkuphelper.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <comphelper/sequence.hxx> #include <osl/diagnose.h> #include <ndtxt.hxx> #include <wrong.hxx> @@ -215,11 +216,7 @@ css::uno::Sequence< css::accessibility::TextSegment > } } - uno::Sequence< css::accessibility::TextSegment > aTextMarkups( - aTmpTextMarkups.size() ); - std::copy( aTmpTextMarkups.begin(), aTmpTextMarkups.end(), aTextMarkups.begin() ); - - return aTextMarkups; + return comphelper::containerToSequence(aTmpTextMarkups ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index d467a21d8a1c..5bc7b4db23b0 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -175,8 +175,8 @@ ErrCode SwReader::Read( const Reader& rOptions ) // store for now all Fly's if( mpCursor ) { - std::copy(mxDoc->GetSpzFrameFormats()->begin(), - mxDoc->GetSpzFrameFormats()->end(), std::back_inserter(aFlyFrameArr)); + aFlyFrameArr.insert( aFlyFrameArr.end(), mxDoc->GetSpzFrameFormats()->begin(), + mxDoc->GetSpzFrameFormats()->end() ); } const sal_Int32 nSttContent = pPam->GetPoint()->nContent.GetIndex(); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index e5723fc0b1c4..0dcc81d6cf2e 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1756,9 +1756,8 @@ void SwWW8Writer::InsAsString8(ww::bytes &rO, const OUString& rStr, OString sTmp(OUStringToOString(rStr, eCodeSet)); const char *pStart = sTmp.getStr(); const char *pEnd = pStart + sTmp.getLength(); - rO.reserve(rO.size() + sTmp.getLength()); - std::copy(pStart, pEnd, std::inserter(rO, rO.end())); + rO.insert( rO.end(), pStart, pEnd ); } void SwWW8Writer::WriteString16(SvStream& rStrm, const OUString& rStr, diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index dc1f02f12e77..a3c74dd1b39e 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -270,8 +270,7 @@ namespace toolkitform if( ! (_rxModel->getPropertyValue( "StringItemList" ) >>= aListEntries) ) { SAL_WARN("toolkit.helper", "getStringItemVector: unable to get property StringItemList"); } - ::std::copy( aListEntries.begin(), aListEntries.end(), - ::std::back_insert_iterator< ::std::vector< OUString > >( _rVector ) ); + _rVector.insert( _rVector.end(), aListEntries.begin(), aListEntries.end() ); } } diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx index 019ca1b86407..2421d228fdf0 100644 --- a/unotools/source/config/dynamicmenuoptions.cxx +++ b/unotools/source/config/dynamicmenuoptions.cxx @@ -488,8 +488,7 @@ void SvtDynamicMenuOptions_Impl::impl_SortAndExpandPropertyNames( const Sequence lDestination.realloc( (nSourceCount*PROPERTYCOUNT)+nDestinationStep ); // get enough memory for copy operations after nDestination ... // Copy all items to temp. vector to use fast sort operations :-) - lTemp.reserve(nSourceCount); - std::copy(lSource.begin(), lSource.end(), std::back_inserter(lTemp)); + lTemp.insert( lTemp.end(), lSource.begin(), lSource.end() ); // Sort all entries by number ... stable_sort( lTemp.begin(), lTemp.end(), CountWithPrefixSort() ); diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx b/vbahelper/source/msforms/vbalistcontrolhelper.cxx index 02a500aa2f8c..07187e56b621 100644 --- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx +++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx @@ -119,7 +119,7 @@ ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargInde sVec.push_back( sString ); // point at first element to copy - std::copy(std::next(sList.begin(), nIndex), sList.end(), std::back_inserter(sVec)); + sVec.insert( sVec.end(), std::next(sList.begin(), nIndex), sList.end() ); sList.realloc( sList.getLength() + 1 ); diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 1efe1e617432..a7c30186633b 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -202,9 +202,7 @@ namespace vcl { MetricVector aGlyphBounds; m_rReferenceDevice.GetGlyphBoundRects( _rStartPoint, _rText, _nStartIndex, _nLength, aGlyphBounds ); - ::std::copy( - aGlyphBounds.begin(), aGlyphBounds.end(), - ::std::insert_iterator< MetricVector > ( *_pVector, _pVector->end() ) ); + _pVector->insert( _pVector->end(), aGlyphBounds.begin(), aGlyphBounds.end() ); *_pDisplayText += _rText.copy( _nStartIndex, _nLength ); return; } diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx index e7e1c8d581c9..f413ced61d41 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx @@ -388,9 +388,7 @@ void OOXMLPropertySet::add(const OOXMLPropertySet::Pointer_t& pPropertySet) if (pSet != nullptr) { - int x = mProperties.size(); - mProperties.resize(mProperties.size() + pSet->mProperties.size()); - std::copy(pSet->mProperties.begin(), pSet->mProperties.end(), mProperties.begin() + x); + mProperties.insert( mProperties.end(), pSet->mProperties.begin(), pSet->mProperties.end() ); } } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 12e97512e615..b38f4df2b84c 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -345,21 +345,6 @@ private: OUString m_aRole; }; -template< typename T > - void lcl_SequenceToVectorAppend( const Sequence< T > & rSource, ::std::vector< T > & rDestination ) -{ - rDestination.reserve( rDestination.size() + rSource.getLength()); - ::std::copy( rSource.begin(), rSource.end(), - ::std::back_inserter( rDestination )); -} - -template< typename T > - void lcl_SequenceToVector( const Sequence< T > & rSource, ::std::vector< T > & rDestination ) -{ - rDestination.clear(); - lcl_SequenceToVectorAppend( rSource, rDestination ); -} - Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Reference< chart2::XDiagram > & xDiagram ) { Reference< chart2::data::XLabeledDataSequence > xResult; @@ -428,7 +413,7 @@ Sequence< Reference< chart2::data::XLabeledDataSequence > > lcl_getAllSeriesSequ if( !xDataSource.is() ) continue; uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() ); - lcl_SequenceToVectorAppend( aDataSequences, aContainer ); + aContainer.insert( aContainer.end(), aDataSequences.begin(), aDataSequences.end() ); } } @@ -678,8 +663,7 @@ uno::Sequence< OUString > lcl_DataSequenceToStringSequence( } } - ::std::copy( aValuesSequence.begin(), aValuesSequence.end(), - ::std::back_inserter( aResult )); + aResult.insert( aResult.end(), aValuesSequence.begin(), aValuesSequence.end() ); return aResult; } @@ -828,7 +812,8 @@ lcl_TableData lcl_getDataForLocalTable( tStringVector& rLabels = bSeriesFromColumns ? aResult.aColumnDescriptions : aResult.aRowDescriptions; //categories - lcl_SequenceToVector( aSimpleCategories, rCategories ); + rCategories.clear(); + rCategories.insert( rCategories.begin(), aSimpleCategories.begin(), aSimpleCategories.end() ); if( !rCategoriesRange.isEmpty() ) { OUString aRange(rCategoriesRange); @@ -3283,8 +3268,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( if( bVaryColorsByPoint && xColorScheme.is() ) { ::std::set< sal_Int32 > aAttrPointSet; - ::std::copy( pPoints, pPoints + aDataPointSeq.getLength(), - ::std::inserter( aAttrPointSet, aAttrPointSet.begin())); + aAttrPointSet.insert( pPoints, pPoints + aDataPointSeq.getLength() ); const ::std::set< sal_Int32 >::const_iterator aEndIt( aAttrPointSet.end()); for( nElement = 0; nElement < nSeriesLength; ++nElement ) { diff --git a/xmloff/source/chart/SchXMLSeriesHelper.cxx b/xmloff/source/chart/SchXMLSeriesHelper.cxx index 00adebc0d347..380830b40fc6 100644 --- a/xmloff/source/chart/SchXMLSeriesHelper.cxx +++ b/xmloff/source/chart/SchXMLSeriesHelper.cxx @@ -53,8 +53,7 @@ using ::com::sun::star::uno::Sequence; { Reference< chart2::XDataSeriesContainer > xDSCnt( rChartType, uno::UNO_QUERY_THROW ); Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() ); - ::std::copy( aSeriesSeq.begin(), aSeriesSeq.end(), - ::std::back_inserter( aResult )); + aResult.insert( aResult.end(), aSeriesSeq.begin(), aSeriesSeq.end() ); } } } diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index b561dcfb058e..d4a7b143590a 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -306,8 +306,7 @@ void SchXMLTableContext::EndElement() if( !bModified ) { SAL_WARN_IF( !aModifiedRow.empty(), "xmloff.chart", "aModifiedRow is NOT NULL"); - aModifiedRow.reserve( rRow.size()); - ::std::copy( rRow.begin(), rRow.end(), ::std::back_inserter( aModifiedRow )); + aModifiedRow.insert( aModifiedRow.end(), rRow.begin(), rRow.end() ); SAL_WARN_IF( aModifiedRow.empty(), "xmloff.chart", "aModifiedRow is NULL"); } SAL_WARN_IF( nDestinationIndex >= aModifiedRow.size(), "xmloff.chart", "nDestinationIndex >= aModifiedRow.size()"); @@ -343,8 +342,7 @@ void SchXMLTableContext::EndElement() if( !bModified ) { SAL_WARN_IF( !aDestination.empty(), "xmloff.chart", "aDestination is NOT NULL"); - aDestination.reserve( mrTable.aData.size()); - ::std::copy( mrTable.aData.begin(), mrTable.aData.end(), ::std::back_inserter( aDestination )); + aDestination.insert( aDestination.end(), mrTable.aData.begin(), mrTable.aData.end()); SAL_WARN_IF( aDestination.empty(), "xmloff.chart", "aDestination is NULL"); } SAL_WARN_IF( nDestinationIndex >= aDestination.size(), "xmloff.chart", "nDestinationIndex >= aDestination.size()"); diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 622d71018633..14178490f7b1 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1388,12 +1388,7 @@ namespace xmloff OSL_ENSURE( aValuePropertyPos->Name == PROPERTY_TEXT, "OTextLikeImport::EndElement: text:p was present, but our value property is *not* 'Text'!" ); if ( aValuePropertyPos->Name == PROPERTY_TEXT ) { - ::std::copy( - aValuePropertyPos + 1, - m_aValues.end(), - aValuePropertyPos - ); - m_aValues.resize( m_aValues.size() - 1 ); + m_aValues.erase(aValuePropertyPos); } } @@ -1443,12 +1438,7 @@ namespace xmloff { // complete remove this property value from the array. Today's "default value" of the "DefaultControl" // property is sufficient - ::std::copy( - aDefaultControlPropertyPos + 1, - m_aValues.end(), - aDefaultControlPropertyPos - ); - m_aValues.resize( m_aValues.size() - 1 ); + m_aValues.erase(aDefaultControlPropertyPos); } } } diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 7601bf1f12c6..133168967fb7 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -145,8 +145,7 @@ void XMLPropertyStates_Impl::FillPropertyStateVector( { if (nCount) { - rVector.resize(nCount, XMLPropertyState(-1)); - ::std::copy( aPropStates.begin(), aPropStates.end(), rVector.begin() ); + rVector.insert( rVector.begin(), aPropStates.begin(), aPropStates.end() ); } } |