comphelper/source/eventattachermgr/eventattachermgr.cxx     |    2 +-
 cppcanvas/source/mtfrenderer/polypolyaction.cxx             |    4 ++--
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx |    6 +++---
 framework/source/dispatch/interceptionhelper.cxx            |    4 ++--
 framework/source/recording/dispatchrecorder.cxx             |    6 ++----
 sc/source/ui/dataprovider/xmldataprovider.cxx               |    2 +-
 svtools/source/dialogs/PlaceEditDialog.cxx                  |    6 +++---
 svx/source/sdr/contact/viewobjectcontact.cxx                |    6 +++---
 svx/source/sdr/contact/viewobjectcontactofe3d.cxx           |    8 ++++----
 sw/source/core/txtnode/fmtatr2.cxx                          |    2 +-
 sw/source/core/unocore/unotext.cxx                          |    2 +-
 unoxml/source/rdf/librdf_repository.cxx                     |   12 ++++++------
 xmloff/source/chart/SchXMLPlotAreaContext.cxx               |    2 +-
 xmloff/source/script/XMLEventsImportContext.cxx             |    3 +--
 xmlsecurity/source/helper/xsecsign.cxx                      |    6 +++---
 15 files changed, 34 insertions(+), 37 deletions(-)

New commits:
commit 4725db25752662ef3ec18e2f454aa632e64cb452
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Jul 31 10:57:12 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Aug 1 17:29:00 2025 +0200

    cid#1659599 Variable copied when it could be moved
    
    and
    
    cid#1659624 Variable copied when it could be moved
    cid#1659632 Variable copied when it could be moved
    cid#1659637 Variable copied when it could be moved
    cid#1659656 Variable copied when it could be moved
    cid#1659662 Variable copied when it could be moved
    
    Change-Id: I20179a4ff699af546694b8a4796ab2f0cfae1903
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188708
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx 
b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index bb6789e031d2..4b056fd8597a 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -579,7 +579,7 @@ void 
ImplEventAttacherManager::attach(std::unique_lock<std::mutex>& l, sal_Int32
     AttachedObject_Impl aTmp;
     aTmp.xTarget = xObject;
     aTmp.aHelper = Helper;
-    aCurrentPosition->aObjList.push_back( aTmp );
+    aCurrentPosition->aObjList.push_back(std::move(aTmp));
 
     AttachedObject_Impl & rCurObj = aCurrentPosition->aObjList.back();
     rCurObj.aAttachedListenerSeq = std::vector< Reference< XEventListener > >( 
aCurrentPosition->aEventList.size() );
diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx 
b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
index 955727a31309..6f4fce09e99d 100644
--- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx
+++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
@@ -153,14 +153,14 @@ namespace cppcanvas::internal
                 {
                     // TODO(E3): Use DBO's finalizer here,
                     // fillPolyPolygon() might throw
-                    const uno::Sequence< double > aTmpColor( 
aLocalState.DeviceColor );
+                    uno::Sequence<double> aTmpColor( aLocalState.DeviceColor );
                     aLocalState.DeviceColor = maFillColor;
 
                     rCachedPrimitive = 
mpCanvas->getUNOCanvas()->fillPolyPolygon( mxPolyPoly,
                                                                                
   mpCanvas->getViewState(),
                                                                                
   aLocalState );
 
-                    aLocalState.DeviceColor = aTmpColor;
+                    aLocalState.DeviceColor = std::move(aTmpColor);
                 }
 
                 if( aLocalState.DeviceColor.hasElements() )
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx 
b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index cc689e6dc67a..d69bb87b865c 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -238,12 +238,12 @@ namespace drawinglayer::primitive3d
                     if(css::drawing::TextureKind2_LUMINANCE == 
aSdr3DObjectAttribute.getTextureKind())
                     {
                         // use modified color primitive to force textures to 
gray
-                        const basegfx::BColorModifierSharedPtr aBColorModifier 
=
+                        basegfx::BColorModifierSharedPtr aBColorModifier =
                             std::make_shared<basegfx::BColorModifier_gray>();
-                        const Primitive3DReference xRef2(
+                        Primitive3DReference xRef2(
                             new ModifiedColorPrimitive3D(
                                 aRetval,
-                                aBColorModifier));
+                                std::move(aBColorModifier)));
 
                         aRetval = { xRef2 };
                     }
diff --git a/framework/source/dispatch/interceptionhelper.cxx 
b/framework/source/dispatch/interceptionhelper.cxx
index da383aa98afa..182f4af33a5d 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -130,7 +130,7 @@ void SAL_CALL 
InterceptionHelper::registerDispatchProviderInterceptor(const css:
     {
         xInterceptor->setMasterDispatchProvider(xThis   );
         xInterceptor->setSlaveDispatchProvider (m_xSlave);
-        m_lInterceptionRegs.push_back(aInfo);
+        m_lInterceptionRegs.push_back(std::move(aInfo));
     }
 
     // b) OK - there is at least one interceptor already registered.
@@ -147,7 +147,7 @@ void SAL_CALL 
InterceptionHelper::registerDispatchProviderInterceptor(const css:
         xInterceptor->setSlaveDispatchProvider (xSlaveD           );
         xSlaveI->setMasterDispatchProvider     (aInfo.xInterceptor);
 
-        m_lInterceptionRegs.push_front(aInfo);
+        m_lInterceptionRegs.push_front(std::move(aInfo));
     }
 
     css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), 
css::uno::UNO_QUERY);
diff --git a/framework/source/recording/dispatchrecorder.cxx 
b/framework/source/recording/dispatchrecorder.cxx
index bce816334ebd..f314704135c5 100644
--- a/framework/source/recording/dispatchrecorder.cxx
+++ b/framework/source/recording/dispatchrecorder.cxx
@@ -116,16 +116,14 @@ void SAL_CALL DispatchRecorder::startRecording( const 
css::uno::Reference< css::
 void SAL_CALL DispatchRecorder::recordDispatch( const css::util::URL& aURL,
                                                 const css::uno::Sequence< 
css::beans::PropertyValue >& lArguments )
 {
-    css::frame::DispatchStatement aStatement( aURL.Complete, OUString(), 
lArguments, 0, false );
-    m_aStatements.push_back( aStatement );
+    m_aStatements.emplace_back(aURL.Complete, OUString(), lArguments, 0, 
false);
 }
 
 void SAL_CALL  DispatchRecorder::recordDispatchAsComment( const 
css::util::URL& aURL,
                                                           const 
css::uno::Sequence< css::beans::PropertyValue >& lArguments )
 {
     // last parameter must be set to true -> it's a comment
-    css::frame::DispatchStatement aStatement( aURL.Complete, OUString(), 
lArguments, 0, true );
-    m_aStatements.push_back( aStatement );
+    m_aStatements.emplace_back(aURL.Complete, OUString(), lArguments, 0, true);
 }
 
 void SAL_CALL DispatchRecorder::endRecording()
diff --git a/sc/source/ui/dataprovider/xmldataprovider.cxx 
b/sc/source/ui/dataprovider/xmldataprovider.cxx
index acdd7ef4a408..7572c3f358ec 100644
--- a/sc/source/ui/dataprovider/xmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/xmldataprovider.cxx
@@ -66,7 +66,7 @@ void XMLFetchThread::execute()
         aRangeLink.maPos = ScAddress(0, 0, 0);
         aRangeLink.maFieldPaths.push_back(OUStringToOString(maID, 
RTL_TEXTENCODING_UTF8));
         maParam.maRangeLinks.clear();
-        maParam.maRangeLinks.push_back(aRangeLink);
+        maParam.maRangeLinks.push_back(std::move(aRangeLink));
     }
     // Do the import.
     SolarMutexGuard aGuard;
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx 
b/svtools/source/dialogs/PlaceEditDialog.cxx
index 2905f502b857..b6231c1530d8 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -212,11 +212,11 @@ void PlaceEditDialog::InitDetails( )
     // Create WebDAV / SSH details control
     std::shared_ptr<DetailsContainer> 
xDavDetails(std::make_shared<DavDetailsContainer>(this));
     xDavDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
-    m_aDetailsContainers.push_back(xDavDetails);
+    m_aDetailsContainers.push_back(std::move(xDavDetails));
 
     std::shared_ptr<DetailsContainer> 
xSshDetails(std::make_shared<HostDetailsContainer>(this, 22, "sftp"));
     xSshDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
-    m_aDetailsContainers.push_back(xSshDetails);
+    m_aDetailsContainers.push_back(std::move(xSshDetails));
 
     // Remove Windows Share entry from dialog on Windows OS, where it's 
non-functional
 #if defined(_WIN32)
@@ -227,7 +227,7 @@ void PlaceEditDialog::InitDetails( )
     // Create Windows Share control
     std::shared_ptr<DetailsContainer> 
xSmbDetails(std::make_shared<SmbDetailsContainer>(this));
     xSmbDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
-    m_aDetailsContainers.push_back(xSmbDetails);
+    m_aDetailsContainers.push_back(std::move(xSmbDetails));
 #endif
 
     // Set default to first value
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index cc025c885110..3ce6e3cba40b 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -339,15 +339,15 @@ void ViewObjectContact::createPrimitive2DSequence(const 
DisplayInfo& rDisplayInf
         // handle ghosted
         if(isPrimitiveGhosted(rDisplayInfo))
         {
-            const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
-            const basegfx::BColorModifierSharedPtr aBColorModifier =
+            basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
+            basegfx::BColorModifierSharedPtr aBColorModifier =
                 std::make_shared<basegfx::BColorModifier_interpolate>(
                     aRGBWhite,
                     0.5);
             xRetval = drawinglayer::primitive2d::Primitive2DContainer{
                     new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
                         std::move(xRetval),
-                        aBColorModifier)
+                        std::move(aBColorModifier))
             };
         }
     }
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx 
b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index c6d41bdc9533..eba5d8148c49 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -42,15 +42,15 @@ namespace sdr::contact
             // handle ghosted
             if(isPrimitiveGhosted(rDisplayInfo))
             {
-                const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
-                const ::basegfx::BColorModifierSharedPtr aBColorModifier =
+                ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
+                ::basegfx::BColorModifierSharedPtr aBColorModifier =
                     std::make_shared<basegfx::BColorModifier_interpolate>(
                         aRGBWhite,
                         0.5);
-                const drawinglayer::primitive3d::Primitive3DReference 
xReference(
+                drawinglayer::primitive3d::Primitive3DReference xReference(
                     new drawinglayer::primitive3d::ModifiedColorPrimitive3D(
                         xRetval,
-                        aBColorModifier));
+                        std::move(aBColorModifier)));
 
                 xRetval = { xReference };
             }
diff --git a/sw/source/core/txtnode/fmtatr2.cxx 
b/sw/source/core/txtnode/fmtatr2.cxx
index cff6ff2a1235..dac0e2d7a2b1 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -853,7 +853,7 @@ std::shared_ptr<MetaField>
 MetaFieldManager::makeMetaField(SwFormatMeta * const i_pFormat,
         const sal_uInt32 nNumberFormat, const bool bIsFixedLanguage)
 {
-    const std::shared_ptr<MetaField> pMetaField(
+    std::shared_ptr<MetaField> pMetaField(
         new MetaField(i_pFormat, nNumberFormat, bIsFixedLanguage) );
     m_MetaFields.push_back(pMetaField);
     return pMetaField;
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 1ef609d05e23..e254014849be 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2236,7 +2236,7 @@ SwXText::convertToSwTable(
             ConvertCell(pRow[nCell], aRowNodes, pLastCell);
         }
         assert(!aRowNodes.empty());
-        aTableNodes.push_back(aRowNodes);
+        aTableNodes.push_back(std::move(aRowNodes));
     }
 
     std::vector< TableColumnSeparators >
diff --git a/unoxml/source/rdf/librdf_repository.cxx 
b/unoxml/source/rdf/librdf_repository.cxx
index aa1cf229b364..92b083084f40 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -1711,7 +1711,7 @@ librdf_Repository::getStatementsRDFa(
         safe_librdf_free_statement);
     OSL_ENSURE(pStatement, "mkStatement failed");
 
-    const std::shared_ptr<librdf_stream> pStream(
+    std::shared_ptr<librdf_stream> pStream(
         librdf_model_find_statements(m_pModel.get(), pStatement.get()),
         safe_librdf_free_stream);
     if (!pStream) {
@@ -1727,7 +1727,7 @@ librdf_Repository::getStatementsRDFa(
             "librdf_stream_add_map failed"_ustr, *this);
     }
 
-    return new librdf_GraphResult(this, m_aMutex, pStream,
+    return new librdf_GraphResult(this, m_aMutex, std::move(pStream),
                                   std::shared_ptr<librdf_node>());
 }
 
@@ -2302,12 +2302,12 @@ librdf_TypeConverter::Statement 
librdf_TypeConverter::extractStatement_NoLock(
     const uno::Reference< rdf::XURI > & i_xPredicate,
     const uno::Reference< rdf::XNode > & i_xObject)
 {
-    std::shared_ptr<Resource> const pSubject(
+    std::shared_ptr<Resource> pSubject(
             extractResource_NoLock(i_xSubject));
-    std::shared_ptr<URI> const pPredicate(
+    std::shared_ptr<URI> pPredicate(
         std::dynamic_pointer_cast<URI>(extractResource_NoLock(i_xPredicate)));
-    std::shared_ptr<Node> const pObject(extractNode_NoLock(i_xObject));
-    return Statement(pSubject, pPredicate, pObject);
+    std::shared_ptr<Node> pObject(extractNode_NoLock(i_xObject));
+    return Statement(std::move(pSubject), std::move(pPredicate), 
std::move(pObject));
 }
 
 librdf_statement* librdf_TypeConverter::mkStatement_Lock(librdf_world* 
i_pWorld,
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx 
b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index cd571bab3562..a1713ff45210 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -1272,7 +1272,7 @@ void SchXMLStatisticsObjectContext::startFastElement 
(sal_Int32 /*Element*/,
             break;
     }
 
-    mrStyleVector.push_back( aStyle );
+    mrStyleVector.push_back(std::move(aStyle));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/script/XMLEventsImportContext.cxx 
b/xmloff/source/script/XMLEventsImportContext.cxx
index 5a57eac9ba22..6c67fd28ff83 100644
--- a/xmloff/source/script/XMLEventsImportContext.cxx
+++ b/xmloff/source/script/XMLEventsImportContext.cxx
@@ -168,8 +168,7 @@ void XMLEventsImportContext::AddEventValues(
     }
     else
     {
-        EventNameValuesPair aPair(rEventName, rValues);
-        m_aCollectEvents.push_back(aPair);
+        m_aCollectEvents.emplace_back(rEventName, rValues);
     }
 }
 
diff --git a/xmlsecurity/source/helper/xsecsign.cxx 
b/xmlsecurity/source/helper/xsecsign.cxx
index 633f51517fce..f211a9981536 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -222,7 +222,7 @@ void XSecController::setX509Certificate(
         isi.signatureInfor.X509Datas.back().back().X509Certificate = 
ouX509Cert;
         isi.signatureInfor.X509Datas.back().back().CertDigest = 
ouX509CertDigest;
         isi.signatureInfor.eAlgorithmID = eAlgorithmID;
-        m_vInternalSignatureInformations.push_back( isi );
+        m_vInternalSignatureInformations.push_back(std::move(isi));
     }
     else
     {
@@ -328,7 +328,7 @@ void XSecController::setSignatureLineValidGraphic(sal_Int32 
nSecurityId,
     {
         InternalSignatureInformation aInformation(nSecurityId, nullptr);
         aInformation.signatureInfor.aValidSignatureImage = xValidGraphic;
-        m_vInternalSignatureInformations.push_back(aInformation);
+        m_vInternalSignatureInformations.push_back(std::move(aInformation));
     }
     else
     {
@@ -347,7 +347,7 @@ void XSecController::setSignatureLineInvalidGraphic(
     {
         InternalSignatureInformation aInformation(nSecurityId, nullptr);
         aInformation.signatureInfor.aInvalidSignatureImage = xInvalidGraphic;
-        m_vInternalSignatureInformations.push_back(aInformation);
+        m_vInternalSignatureInformations.push_back(std::move(aInformation));
     }
     else
     {

Reply via email to