comphelper/source/misc/backupfilehelper.cxx | 2 +- desktop/source/migration/migration.cxx | 2 +- lingucomponent/source/languageguessing/simpleguesser.cxx | 5 +---- sc/source/filter/xml/XMLStylesExportHelper.cxx | 3 +-- sd/source/filter/ppt/pptin.cxx | 3 +-- sfx2/source/notebookbar/SfxNotebookBar.cxx | 2 +- svx/source/table/tablertfimporter.cxx | 2 +- xmloff/source/table/XMLTableImport.cxx | 2 +- xmlsecurity/source/helper/pdfsignaturehelper.cxx | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-)
New commits: commit 3d36a94b25218a75630543633530749c177cc533 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Aug 4 18:59:02 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Aug 4 22:05:59 2025 +0200 cid#1660296 Variable copied when it could be moved and cid#1660283 Variable copied when it could be moved cid#1660278 Variable copied when it could be moved cid#1660277 Variable copied when it could be moved cid#1660272 Variable copied when it could be moved cid#1660271 Variable copied when it could be moved cid#1660269 Variable copied when it could be moved cid#1660257 Variable copied when it could be moved cid#1660251 Variable copied when it could be moved Change-Id: I6684eaf2162dd3550e2eab3f72cccbaa09448f43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188925 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index 8abd65b7d9fa..8548c4f3ff83 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -1185,7 +1185,7 @@ namespace if (aEntry.read_header(aSourceFile)) { // add to local data - maPackedFileEntryVector.push_back(aEntry); + maPackedFileEntryVector.push_back(std::move(aEntry)); } else { diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 3c7e51d804fa..0739475c44dd 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -373,7 +373,7 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName) // generic service tmpAccess->getByName(u"MigrationService"_ustr) >>= tmpStep.service; - vrMigrations->push_back(tmpStep); + vrMigrations->push_back(std::move(tmpStep)); } return vrMigrations; } diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx b/lingucomponent/source/languageguessing/simpleguesser.cxx index 7210b1f451e3..cec24af8b85c 100644 --- a/lingucomponent/source/languageguessing/simpleguesser.cxx +++ b/lingucomponent/source/languageguessing/simpleguesser.cxx @@ -129,10 +129,7 @@ std::vector<Guess> SimpleGuesser::GuessLanguage(const char* text) current_pointer++; if(guess_list[current_pointer] != ' { - Guess g(guess_list + current_pointer); - - guesses.push_back(g); - + guesses.emplace_back(guess_list + current_pointer); current_pointer++; } } diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index afa0e9b87a71..4daac20f73df 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -940,8 +940,7 @@ void ScColumnStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields if (nTable > nSize) for (sal_Int32 i = nSize; i < nTable; ++i) { - ScMyColumnStyleVec aFieldsVec(nFields + 1, ScColumnStyle()); - aTables.push_back(aFieldsVec); + aTables.emplace_back(nFields + 1, ScColumnStyle()); } } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index e774dc9f0048..0753c30a77a7 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1863,8 +1863,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations tAnimationMap::iterator aFound = maAnimations.find( pObj ); if( aFound != maAnimations.end() ) { - std::pair< SdrObject*, Ppt97AnimationPtr > aPair( (*aFound).first, (*aFound).second ); - aAnimationsOnThisPage.push_back( aPair ); + aAnimationsOnThisPage.emplace_back((*aFound).first, (*aFound).second); } } diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 435e01e34d1b..424f8e61ff8c 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -132,7 +132,7 @@ static void NotebookbarAddonValues( aImage = Image(aAddonsItems.GetImageFromURL(sImage, isBigImage)); } } - aImageValues.push_back(aImage); + aImageValues.push_back(std::move(aImage)); } aExtensionValues.push_back(aExtension); } diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index a2cc1de2ec5e..16d6ad91a87b 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -251,7 +251,7 @@ void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo ) xCellInfo->mxVMergeCell->mnRowSpan++; } - xColumn->push_back( xCellInfo ); + xColumn->push_back(std::move(xCellInfo)); } mnStartPara = pInfo->aSelection.end.nPara - 1; diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 3982a577fa21..a1effb5c5117 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -384,7 +384,7 @@ SvXMLImportContextRef XMLTableImportContext::ImportColumn( const Reference< XFas if( nRepeated <= 1 ) { - maColumnInfos.push_back( xInfo ); + maColumnInfos.push_back(std::move(xInfo)); } else { diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx index a0073ecd993a..ebf5e83356a0 100644 --- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx +++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx @@ -476,7 +476,7 @@ bool PDFSignatureHelper::ReadAndVerifySignatureSvStream(SvStream& rStream) SAL_WARN("xmlsecurity.helper", "failed to determine digest match"); } - m_aSignatureInfos.push_back(aInfo); + m_aSignatureInfos.push_back(std::move(aInfo)); } return true;
