basctl/source/basicide/scriptdocument.cxx | 4 ++-- reportdesign/source/ui/misc/FunctionHelper.cxx | 3 +-- sc/source/core/data/dpgroup.cxx | 2 +- sd/source/console/PresenterTheme.cxx | 2 +- sw/source/filter/ww8/wrtww8.cxx | 4 ++-- unoidl/source/sourceprovider-parser.y | 2 +- unoxml/source/rdf/librdf_repository.cxx | 6 +++--- vcl/source/helper/driverblocklist.cxx | 4 ++-- xmloff/source/chart/SchXMLChartContext.cxx | 5 ++--- xmloff/source/chart/SchXMLTableContext.cxx | 2 +- xmloff/source/forms/property_meta_data.cxx | 2 +- 11 files changed, 17 insertions(+), 19 deletions(-)
New commits: commit 1dcdc80798e710e5709ffda88bbf0c8348a94826 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Aug 4 19:08:24 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 5 09:42:05 2025 +0200 cid#1660247 Variable copied when it could be moved and cid#1660246 Variable copied when it could be moved cid#1660243 Variable copied when it could be moved cid#1660240 Variable copied when it could be moved cid#1660237 Variable copied when it could be moved cid#1660235 Variable copied when it could be moved cid#1660234 Variable copied when it could be moved cid#1660230 Variable copied when it could be moved cid#1660228 Variable copied when it could be moved cid#1660225 Variable copied when it could be moved cid#1660223 Variable copied when it could be moved Change-Id: I3cd87174e8e88a9c55101a73399117c3f2b80644 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188926 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 7bfc082052c2..e0f4efde3094 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -1078,12 +1078,12 @@ namespace basctl for (auto const& doc : aDocuments) { - const ScriptDocument aCheck( doc.xModel ); + ScriptDocument aCheck( doc.xModel ); if ( _rUrlOrCaption == aCheck.getTitle() || _rUrlOrCaption == aCheck.m_pImpl->getURL() ) { - aDocument = aCheck; + aDocument = std::move(aCheck); break; } } diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index e4ec31aad8e2..e4928da849f2 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -135,8 +135,7 @@ const formula::IFunctionDescription* FunctionCategory::getFunction(sal_uInt32 _n if ( _nPos >= m_aFunctions.size() && _nPos < m_nFunctionCount ) { uno::Reference< report::meta::XFunctionDescription> xFunctionDescription = m_xCategory->getFunction(_nPos); - std::shared_ptr< FunctionDescription > pFunction = m_pFunctionManager->get(xFunctionDescription); - m_aFunctions.push_back( pFunction ); + m_aFunctions.push_back(m_pFunctionManager->get(xFunctionDescription)); } return m_aFunctions[_nPos].get(); } diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index 336388a36daf..07f584e552f3 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -689,7 +689,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio std::make_shared<ScDPGroupNumFilter>(std::move(aMatchValues), *pNumInfo); } - aNewCriteria.push_back(aCri); + aNewCriteria.push_back(std::move(aCri)); } else { diff --git a/sd/source/console/PresenterTheme.cxx b/sd/source/console/PresenterTheme.cxx index 5fefc7f2235e..2f45578130de 100644 --- a/sd/source/console/PresenterTheme.cxx +++ b/sd/source/console/PresenterTheme.cxx @@ -846,7 +846,7 @@ void PaneStyleContainer::ProcessPaneStyle( rReadContext.mxCanvas); } - mStyles.push_back(pStyle); + mStyles.push_back(std::move(pStyle)); } SharedPaneStyle PaneStyleContainer::GetPaneStyle (const OUString& rsStyleName) const diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index b6af01c776bf..58624c61eb5d 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1826,7 +1826,7 @@ void MSWordExportBase::WriteSpecialText( SwNodeOffset nStart, SwNodeOffset nEnd, { sal_uInt8 nOldTyp = m_nTextTyp; m_nTextTyp = nTTyp; - auto const pOldPam = m_pCurPam; //!! Simply shifting the PaM without restoring should do the job too + auto pOldPam = m_pCurPam; //!! Simply shifting the PaM without restoring should do the job too SwNodeOffset nOldStart = m_nCurStart; SwNodeOffset nOldEnd = m_nCurEnd; SwPaM* pOldEnd = m_pOrigPam; @@ -1852,7 +1852,7 @@ void MSWordExportBase::WriteSpecialText( SwNodeOffset nStart, SwNodeOffset nEnd, m_pTableInfo = std::move(xOldTableInfo); m_bOutPageDescs = bOldPageDescs; - m_pCurPam = pOldPam; // delete Pam + m_pCurPam = std::move(pOldPam); // delete Pam m_nCurStart = nOldStart; m_nCurEnd = nOldEnd; m_pOrigPam = pOldEnd; diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index 5e3dfac23be1..31beba88e0a5 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -503,7 +503,7 @@ Found findEntity( } break; } - args.push_back(argType); + args.push_back(std::move(argType)); } i = j; } while (i != typeNucleus.getLength() diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 92b083084f40..f58877c94bf5 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -1382,7 +1382,7 @@ librdf_Repository::querySelect(const OUString & i_rQuery) std::scoped_lock g(m_aMutex); const OString query( OUStringToOString(i_rQuery, RTL_TEXTENCODING_UTF8) ); - const std::shared_ptr<librdf_query> pQuery( + std::shared_ptr<librdf_query> pQuery( librdf_new_query(m_pWorld.get(), s_sparql, nullptr, reinterpret_cast<const unsigned char*> (query.getStr()), nullptr), safe_librdf_free_query); @@ -1391,7 +1391,7 @@ librdf_Repository::querySelect(const OUString & i_rQuery) u"librdf_Repository::querySelect: " "librdf_new_query failed"_ustr, *this); } - const std::shared_ptr<librdf_query_results> pResults( + std::shared_ptr<librdf_query_results> pResults( librdf_model_query_execute(m_pModel.get(), pQuery.get()), safe_librdf_free_query_results); if (!pResults || !librdf_query_results_is_bindings(pResults.get())) { @@ -1420,7 +1420,7 @@ librdf_Repository::querySelect(const OUString & i_rQuery) } return new librdf_QuerySelectResult(this, m_aMutex, - pQuery, pResults, names); + std::move(pQuery), std::move(pResults), names); } uno::Reference< container::XEnumeration > SAL_CALL diff --git a/vcl/source/helper/driverblocklist.cxx b/vcl/source/helper/driverblocklist.cxx index 03e3bc52e2af..3edf5cb482dd 100644 --- a/vcl/source/helper/driverblocklist.cxx +++ b/vcl/source/helper/driverblocklist.cxx @@ -460,13 +460,13 @@ void Parser::handleList(xmlreader::XmlReader& rReader) { DriverInfo aDriver; handleEntry(aDriver, rReader); - mrDriverList.push_back(aDriver); + mrDriverList.push_back(std::move(aDriver)); } else if (name == "entryRange") { DriverInfo aDriver; handleEntry(aDriver, rReader); - mrDriverList.push_back(aDriver); + mrDriverList.push_back(std::move(aDriver)); } else { diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 297939f7e9f7..b7b9ff090be0 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -492,9 +492,8 @@ struct NewDonutSeries { ::std::vector< DataRowPointStyle > aRet; - DataRowPointStyle aSeriesStyle( DataRowPointStyle::DATA_SERIES - , m_xSeries, -1, 1, msStyleName, mnAttachedAxis ); - aRet.push_back( aSeriesStyle ); + aRet.emplace_back(DataRowPointStyle::DATA_SERIES + , m_xSeries, -1, 1, msStyleName, mnAttachedAxis); sal_Int32 nPointIndex=0; for (auto const& pointStyle : m_aPointStyles) diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index ecff70a1bc0d..0199417a3519 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -609,7 +609,7 @@ void SchXMLTableCellContext::startFastElement (sal_Int32 /*nElement*/, mbReadText = false; } - mrTable.aData[ mrTable.nRowIndex ].push_back( aCell ); + mrTable.aData[ mrTable.nRowIndex ].push_back(std::move(aCell)); mrTable.nColumnIndex++; if( mrTable.nMaxColumnIndex < mrTable.nColumnIndex ) mrTable.nMaxColumnIndex = mrTable.nColumnIndex; diff --git a/xmloff/source/forms/property_meta_data.cxx b/xmloff/source/forms/property_meta_data.cxx index 8c81e7627c01..9d185367998f 100644 --- a/xmloff/source/forms/property_meta_data.cxx +++ b/xmloff/source/forms/property_meta_data.cxx @@ -111,7 +111,7 @@ namespace xmloff::metadata PropertyDescriptionList singleElementList; singleElementList.push_back( desc ); - s_attributesWithoutGroup[ desc->attribute ].push_back( singleElementList ); + s_attributesWithoutGroup[ desc->attribute ].push_back(std::move(singleElementList)); ++desc; } }