basic/source/runtime/runtime.cxx | 2 +- desktop/source/deployment/manager/dp_extensionmanager.cxx | 2 +- idl/source/objects/types.cxx | 2 +- oox/source/drawingml/diagram/diagram.cxx | 3 ++- oox/source/drawingml/textcharacterproperties.cxx | 2 +- oox/source/ole/olestorage.cxx | 2 +- sc/source/core/data/column4.cxx | 2 +- sc/source/core/tool/compiler.cxx | 2 +- sc/source/filter/oox/extlstcontext.cxx | 2 +- sc/source/ui/view/cellsh2.cxx | 2 +- sc/source/ui/view/viewfun2.cxx | 3 ++- sd/source/ui/sidebar/MasterPageObserver.cxx | 4 ++-- starmath/source/mathml/mathmlimport.cxx | 2 +- svl/source/misc/urihelper.cxx | 2 +- svx/source/engine3d/dragmt3d.cxx | 2 +- svx/source/engine3d/extrud3d.cxx | 2 +- sw/source/uibase/dochdl/swdtflvr.cxx | 2 +- ucb/source/ucp/package/pkgcontent.cxx | 2 +- unotools/source/i18n/textsearch.cxx | 2 +- xmlsecurity/source/helper/pdfsignaturehelper.cxx | 2 +- 20 files changed, 23 insertions(+), 21 deletions(-)
New commits: commit 1b61a652c1e19ff0ce2765e374fb179189235926 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Aug 2 19:51:40 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Aug 4 15:38:31 2024 +0200 cid#1556583 COPY_INSTEAD_OF_MOVE and cid#1556585 COPY_INSTEAD_OF_MOVE cid#1556588 COPY_INSTEAD_OF_MOVE cid#1556593 COPY_INSTEAD_OF_MOVE cid#1556597 COPY_INSTEAD_OF_MOVE cid#1556605 COPY_INSTEAD_OF_MOVE cid#1556617 COPY_INSTEAD_OF_MOVE cid#1556635 COPY_INSTEAD_OF_MOVE cid#1556790 COPY_INSTEAD_OF_MOVE cid#1556792 COPY_INSTEAD_OF_MOVE cid#1556796 COPY_INSTEAD_OF_MOVE cid#1556799 COPY_INSTEAD_OF_MOVE cid#1556815 COPY_INSTEAD_OF_MOVE cid#1556836 COPY_INSTEAD_OF_MOVE cid#1556840 COPY_INSTEAD_OF_MOVE cid#1556842 COPY_INSTEAD_OF_MOVE cid#1556859 COPY_INSTEAD_OF_MOVE cid#1556860 COPY_INSTEAD_OF_MOVE cid#1556866 COPY_INSTEAD_OF_MOVE cid#1556869 COPY_INSTEAD_OF_MOVE cid#1556870 COPY_INSTEAD_OF_MOVE Change-Id: I3df8698a4aecbb03999c084517e37e12ff46ee97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171435 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index c8540f9a4fe7..7d3f15d46f16 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1816,7 +1816,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b if( refObjVal.is() ) { - refVal = refObjVal; + refVal = std::move(refObjVal); } else if( !(eValType & SbxARRAY) ) { diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 29504fd32954..61fa44517be9 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -264,7 +264,7 @@ void ExtensionManager::addExtensionsToMap( { std::vector<Reference<css::deployment::XPackage> > vec(3); vec[index] = xExtension; - mapExt[id] = vec; + mapExt[id] = std::move(vec); } else { diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 08fa843d6f96..8f6c949af531 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -76,7 +76,7 @@ bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase, { tools::SvRef<SvMetaType> xT(new SvMetaType() ); xT->SetRef( GetType() ); - aType = xT; + aType = std::move(xT); bOk = aType->ReadMethodArgs( rBase, rInStm ); } if( bOk ) diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index fb3c9a0f3b8f..3928e82767ed 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -369,7 +369,8 @@ void loadDiagram( ShapePtr const & pShape, if (!rLayoutPath.isEmpty()) { rtl::Reference< core::FragmentHandler > xRefLayout( - new DiagramLayoutFragmentHandler( rFilter, rLayoutPath, pLayout )); + new DiagramLayoutFragmentHandler( rFilter, rLayoutPath, + std::move(pLayout) )); importFragment(rFilter, loadFragment(rFilter,xRefLayout), diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 31be8a63a609..eafa93bf2c46 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -132,7 +132,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil // then this is contoured text in LO. if (nLineTransparency < aColor.getTransparency() || (bContoured = aColor.getColor(rFilter.getGraphicHelper()) == COL_WHITE)) - aColor = aLineColor; + aColor = std::move(aLineColor); } rPropMap.setProperty(PROP_CharColor, aColor.getColor(rFilter.getGraphicHelper())); diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx index b223f376d82a..be7b1c71f3ef 100644 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -318,7 +318,7 @@ StorageRef OleStorage::implOpenSubStorage( const OUString& rElementName, bool bC if( xSubStorage ) xSubStorage->copyStorageToStorage( *xTempStorage ); // return the temp storage to caller - xSubStorage = xTempStorage; + xSubStorage = std::move(xTempStorage); } catch(const Exception& ) { diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index c122a142ad5d..81d95895967f 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -389,7 +389,7 @@ void ScColumn::duplicateSparkline(sc::CopyFromClipContext& rContext, sc::ColumnB { auto pNewSparkline = std::make_shared<sc::Sparkline>(aCurrentPosition.Col(), aCurrentPosition.Row(), pDuplicatedGroup); pNewSparkline->setInputRange(pSparkline->getInputRange()); - aSparklines[i] = new sc::SparklineCell(pNewSparkline); + aSparklines[i] = new sc::SparklineCell(std::move(pNewSparkline)); aCurrentPosition.IncRow(); } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index f8bdb096f54d..1329a8a90d96 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -5083,7 +5083,7 @@ std::unique_ptr<ScTokenArray> ScCompiler::CompileString( const OUString& rFormul if( ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, aTokenSeq ) ) { // remember pArr, in case a subsequent CompileTokenArray() is executed. - std::unique_ptr<ScTokenArray> pNew(new ScTokenArray( aTokenArray )); + std::unique_ptr<ScTokenArray> pNew(new ScTokenArray( std::move(aTokenArray) )); // coverity[escape : FALSE] - ownership of pNew is retained by caller, so pArr remains valid pArr = pNew.get(); maArrIterator = FormulaTokenArrayPlainIterator(*pArr); diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index c720e6beb3ce..5bdfd1943b4e 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -80,7 +80,7 @@ void ExtCfRuleContext::onStartElement( const AttributeList& rAttribs ) xRule->importCfvo( rAttribs ); xRule->getModel().mbIsLower = mbFirstEntry; mbFirstEntry = false; - mpRule = xRule; + mpRule = std::move(xRule); break; } default: diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 91f24d70a0fa..a1580b8958cc 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -814,7 +814,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) auto xDoc = o3tl::make_shared<ScDocument>(); xDoc->InsertTab(0, u"test"_ustr); ScDocument& rDoc = GetViewData().GetDocument(); - ScDataProviderDlg aDialog(pTabViewShell->GetDialogParent(), xDoc, &rDoc); + ScDataProviderDlg aDialog(pTabViewShell->GetDialogParent(), std::move(xDoc), &rDoc); if (aDialog.run() == RET_OK) { aDialog.import(rDoc); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index edd609ee3b9d..09ba678edd6f 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1253,7 +1253,8 @@ void ScViewFunc::MergeCells( bool bApi, bool bDoContents, bool bCenter, bool bEmptyMergedCells = officecfg::Office::Calc::Compatibility::MergeCells::EmptyMergedCells::get(); - auto doMerge = [this, pDocSh, aMergeOption, bApi, nStartCol, nStartRow, aMarkRange] + auto doMerge = [this, pDocSh, aMergeOption=std::move(aMergeOption), + bApi, nStartCol, nStartRow, aMarkRange] (bool bNowDoContents, bool bNowEmptyMergedCells) { if (pDocSh->GetDocFunc().MergeCells(aMergeOption, bNowDoContents, true/*bRecord*/, diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx index 724b7b5e8f86..08677377a97e 100644 --- a/sd/source/ui/sidebar/MasterPageObserver.cxx +++ b/sd/source/ui/sidebar/MasterPageObserver.cxx @@ -144,7 +144,7 @@ void MasterPageObserver::Implementation::RegisterDocument ( } bool bAlreadyExists = maUsedMasterPages.find(&rDocument) != maUsedMasterPages.end(); - maUsedMasterPages[&rDocument] = aMasterPageSet; + maUsedMasterPages[&rDocument] = std::move(aMasterPageSet); if (!bAlreadyExists) StartListening (rDocument); @@ -280,7 +280,7 @@ void MasterPageObserver::Implementation::AnalyzeUsedMasterPages ( } // Store the new list of master pages. - aOldMasterPagesDescriptor->second = aCurrentMasterPages; + aOldMasterPagesDescriptor->second = std::move(aCurrentMasterPages); } void MasterPageObserver::Implementation::SendEvent ( diff --git a/starmath/source/mathml/mathmlimport.cxx b/starmath/source/mathml/mathmlimport.cxx index 2f0b26c60f4a..1ed7b5815b2c 100644 --- a/starmath/source/mathml/mathmlimport.cxx +++ b/starmath/source/mathml/mathmlimport.cxx @@ -299,7 +299,7 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent(const Reference<io::XInputStrea { xml::sax::SAXException aTmp; if (aSaxEx.WrappedException >>= aTmp) - aSaxEx = aTmp; + aSaxEx = std::move(aTmp); else bTryChild = false; } diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 8efae06979f0..f64390d47d49 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -99,7 +99,7 @@ OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, bMaybeFile = rMaybeFileHdl.Call(&aFilePath); } if (!bMaybeFile) - aAbsURIRef = aNonFileURIRef; + aAbsURIRef = std::move(aNonFileURIRef); } } } diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index 2c5147321ae6..cfc3dedf67ca 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -703,7 +703,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) aNewTrans *= rCandidate.maInvDisplayTransform; // ...and apply - rCandidate.maTransform = aNewTrans; + rCandidate.maTransform = std::move(aNewTrans); if(mbMoveFull) { diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx index c268bec20baa..fa9b73e02797 100644 --- a/svx/source/engine3d/extrud3d.cxx +++ b/svx/source/engine3d/extrud3d.cxx @@ -176,7 +176,7 @@ rtl::Reference<SdrAttrObj> E3dExtrudeObj::GetBreakObj() if(aFrontSide.count()) { - aBackSide = aFrontSide; + aBackSide = std::move(aFrontSide); if(GetExtrudeDepth()) { diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index b5cd76930891..1b1c862c1963 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -1364,7 +1364,7 @@ SwPasteContext::~SwPasteContext() return; // Invoke the listeners. - uno::Sequence<beans::PropertyValue> aEvent{ aPropertyValue }; + uno::Sequence<beans::PropertyValue> aEvent{ std::move(aPropertyValue) }; m_rWrtShell.GetPasteListeners().notifyEach( &css::text::XPasteListener::notifyPasteEvent, aEvent ); } catch (const uno::Exception& rException) diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index aac57a638d7e..05b635725cf5 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -1585,7 +1585,7 @@ void Content::insert( if ( bNewId ) { m_xIdentifier = new ::ucbhelper::ContentIdentifier( aNewURL ); - m_aUri = aNewUri; + m_aUri = std::move(aNewUri); } if ( !storeData( xStream ) ) diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx index 6c65b95cdea9..8ede24667417 100644 --- a/unotools/source/i18n/textsearch.cxx +++ b/unotools/source/i18n/textsearch.cxx @@ -250,7 +250,7 @@ bool TextSearch::SearchBackward( const OUString & rStr, sal_Int32* pStart, *pEnd = aRet.startOffset[ 0 ]; *pStart = aRet.endOffset[ 0 ]; if( pRes ) - *pRes = aRet; + *pRes = std::move(aRet); } } } diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx index d5f789bd6b65..9927f8773d8a 100644 --- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx +++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx @@ -453,7 +453,7 @@ bool PDFSignatureHelper::ReadAndVerifySignatureSvStream(SvStream& rStream) std::unique_ptr<vcl::pdf::PDFiumSignature> pSignature = pPdfDocument->getSignature(i); std::vector<std::pair<size_t, size_t>> aByteRanges; GetByteRangesFromPDF(pSignature, aByteRanges); - aSignatures[i] = Signature{ std::move(pSignature), aByteRanges }; + aSignatures[i] = Signature{ std::move(pSignature), std::move(aByteRanges) }; } std::set<unsigned int> aSignatureEOFs;