compilerplugins/clang/moveit.cxx              |   23 ++++++++++++++++++++---
 compilerplugins/clang/test/moveit.cxx         |   17 +++++++++++++++++
 emfio/source/reader/mtftools.cxx              |    4 ++--
 sc/source/core/data/postit.cxx                |    4 ++--
 sc/source/core/data/table1.cxx                |    2 +-
 sc/source/core/tool/chgtrack.cxx              |    2 +-
 sc/source/core/tool/interpr4.cxx              |    6 +++---
 sc/source/core/tool/token.cxx                 |    6 +++---
 sc/source/filter/excel/xeformula.cxx          |    2 +-
 sc/source/ui/app/scmod.cxx                    |    2 +-
 sc/source/ui/app/seltrans.cxx                 |    4 ++--
 sc/source/ui/docshell/externalrefmgr.cxx      |    4 ++--
 sc/source/ui/navipi/content.cxx               |    4 ++--
 sc/source/ui/optdlg/tpdefaults.cxx            |    2 +-
 sc/source/ui/optdlg/tpformula.cxx             |    2 +-
 sc/source/ui/view/cellsh1.cxx                 |    2 +-
 sc/source/ui/view/drawvie4.cxx                |    6 +++---
 sc/source/ui/view/select.cxx                  |    2 +-
 sc/source/ui/view/tabcont.cxx                 |    2 +-
 sc/source/ui/view/viewfun3.cxx                |    6 +++---
 sd/source/ui/animations/motionpathtag.cxx     |    4 ++--
 sd/source/ui/dlg/sdtreelb.cxx                 |    2 +-
 sw/source/core/access/accmap.cxx              |    4 ++--
 sw/source/core/edit/autofmt.cxx               |    4 ++--
 sw/source/core/text/porlay.cxx                |    2 +-
 sw/source/core/unocore/unofield.cxx           |    2 +-
 sw/source/filter/ww8/ww8atr.cxx               |    2 +-
 sw/source/filter/xml/xmltble.cxx              |    4 ++--
 sw/source/filter/xml/xmltexti.cxx             |    2 +-
 ucb/source/core/ucbcmds.cxx                   |    2 +-
 ucb/source/ucp/hierarchy/hierarchycontent.cxx |    2 +-
 ucb/source/ucp/package/pkgcontent.cxx         |    4 ++--
 ucb/source/ucp/tdoc/tdoc_content.cxx          |    2 +-
 33 files changed, 86 insertions(+), 52 deletions(-)

New commits:
commit 010e2a574c7fadfb60d6794a1bfb38acc8082e0a
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Aug 18 11:35:40 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Aug 18 13:44:43 2022 +0200

    loplugin:moveit
    
    Change-Id: I34de7408553e4ca702cab9aa611c03dc60b9b6a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138472
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/moveit.cxx b/compilerplugins/clang/moveit.cxx
index 116e5ddecbd2..ac1718a35ac7 100644
--- a/compilerplugins/clang/moveit.cxx
+++ b/compilerplugins/clang/moveit.cxx
@@ -42,9 +42,26 @@ public:
     {
         std::string fn(handler.getMainFileName());
         loplugin::normalizeDotDotInFilePath(fn);
-        //        // false +
-        //        if (loplugin::hasPathnamePrefix(fn, SRCDIR 
"/basctl/source/basicide/moduldlg.cxx"))
-        //            return false;
+        // false +, needs to check if the moved-from var is outside a loop
+        if (loplugin::hasPathnamePrefix(
+                fn, SRCDIR 
"/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(
+                fn, SRCDIR 
"/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(fn, SRCDIR 
"/drawinglayer/source/tools/emfphelperdata.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(fn, SRCDIR 
"/sc/source/core/tool/reftokenhelper.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(fn,
+                                        SRCDIR 
"/svx/source/svdraw/svdotextpathdecomposition.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(fn, SRCDIR 
"/svx/source/svdraw/svdcrtv.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(fn, SRCDIR 
"/svx/source/table/tablehandles.cxx"))
+            return false;
+        if (loplugin::hasPathnamePrefix(fn, SRCDIR 
"/svx/source/xoutdev/xpool.cxx"))
+            return false;
         return true;
     }
 
diff --git a/compilerplugins/clang/test/moveit.cxx 
b/compilerplugins/clang/test/moveit.cxx
index dfe64c42777e..9e4fa4f3d814 100644
--- a/compilerplugins/clang/test/moveit.cxx
+++ b/compilerplugins/clang/test/moveit.cxx
@@ -18,6 +18,9 @@ struct Movable
     std::shared_ptr<int> x;
 
     void method1();
+
+    Movable();
+    Movable(int);
 };
 
 namespace test1a
@@ -85,4 +88,18 @@ struct F
 };
 }
 
+// No error expected, because constructing temporary(i.e. rvalue) to pass to 
param
+namespace test4
+{
+struct F
+{
+    F(Movable);
+    void foo()
+    {
+        F a((Movable(5)));
+        (void)a;
+    }
+};
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 95c51188bc3f..b6e225bfd97c 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1401,7 +1401,7 @@ namespace emfio
             ImplSetNonPersistentLineColorTransparenz();
             mpGDIMetaFile->AddAction( new MetaEllipseAction( ImplMap( rRect ) 
) );
             UpdateLineStyle();
-            mpGDIMetaFile->AddAction( new MetaPolyLineAction( tools::Polygon( 
aCenter, aRad.Width(), aRad.Height() ), maLineStyle.aLineInfo ) );
+            mpGDIMetaFile->AddAction( new MetaPolyLineAction( tools::Polygon( 
std::move(aCenter), aRad.Width(), aRad.Height() ), maLineStyle.aLineInfo ) );
         }
         else
         {
@@ -1427,7 +1427,7 @@ namespace emfio
                 Point aCenter( aRect.Center() );
                 Size  aRad( aRect.GetWidth() / 2, aRect.GetHeight() / 2 );
 
-                mpGDIMetaFile->AddAction( new MetaPolyLineAction( 
tools::Polygon( aCenter, aRad.Width(), aRad.Height() ), maLineStyle.aLineInfo ) 
);
+                mpGDIMetaFile->AddAction( new MetaPolyLineAction( 
tools::Polygon( std::move(aCenter), aRad.Width(), aRad.Height() ), 
maLineStyle.aLineInfo ) );
             }
             else
                 mpGDIMetaFile->AddAction( new MetaPolyLineAction( 
tools::Polygon( aRect, aStart, aEnd, PolyStyle::Arc ), maLineStyle.aLineInfo ) 
);
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index b2de7a6843d7..6f1a502fbdaf 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1266,7 +1266,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
 
     /*  Create the note and insert it into the document. If the note is
         visible, the caption object will be created automatically. */
-    ScPostIt* pNote = new ScPostIt( rDoc, rPos, aNoteData, 
/*bAlwaysCreateCaption*/false, 0/*nPostItId*/ );
+    ScPostIt* pNote = new ScPostIt( rDoc, rPos, std::move(aNoteData), 
/*bAlwaysCreateCaption*/false, 0/*nPostItId*/ );
     pNote->AutoStamp();
 
     rDoc.SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
@@ -1289,7 +1289,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromString(
 
         /*  Create the note and insert it into the document. If the note is
             visible, the caption object will be created automatically. */
-        pNote = new ScPostIt( rDoc, rPos, aNoteData, bAlwaysCreateCaption, 
nPostItId );
+        pNote = new ScPostIt( rDoc, rPos, std::move(aNoteData), 
bAlwaysCreateCaption, nPostItId );
         pNote->AutoStamp();
         //insert takes ownership
         rDoc.SetNote(rPos, std::unique_ptr<ScPostIt>(pNote));
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 0eaf10c786da..7a1b860b2a6b 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2506,7 +2506,7 @@ formula::FormulaTokenRef ScTable::ResolveStaticReference( 
SCCOL nCol1, SCROW nRo
             return formula::FormulaTokenRef();
     }
 
-    return formula::FormulaTokenRef(new ScMatrixToken(pMat));
+    return formula::FormulaTokenRef(new ScMatrixToken(std::move(pMat)));
 }
 
 formula::VectorRefArray ScTable::FetchVectorRefArray( SCCOL nCol, SCROW nRow1, 
SCROW nRow2 )
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index ccfea08c8561..925b30378c1a 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -4470,7 +4470,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* 
pDocument ) const
                         pAction->GetUser(),
                         pAction->GetDateTimeUTC(),
                         pAction->GetComment(),
-                        aClonedOldCell,
+                        std::move(aClonedOldCell),
                         pDocument,
                         aOldValue );
 
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 03b786955299..bace28f68a53 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -990,7 +990,7 @@ ScDBRangeBase* ScInterpreter::PopDBDoubleRef()
                 PopExternalDoubleRef(pMat);
             if (nGlobalError != FormulaError::NONE)
                 break;
-            return new ScDBExternalRange(&mrDoc, pMat);
+            return new ScDBExternalRange(&mrDoc, std::move(pMat));
         }
         default:
             SetError( FormulaError::IllegalParameter);
@@ -1528,7 +1528,7 @@ bool ScInterpreter::ConvertMatrixParameters()
                                 if ( nJumpRows < o3tl::make_unsigned(nRow2 - 
nRow1 + 1) )
                                     nJumpRows = static_cast<SCSIZE>(nRow2 - 
nRow1 + 1);
                             }
-                            formula::FormulaToken* pNew = new ScMatrixToken( 
pMat);
+                            formula::FormulaToken* pNew = new ScMatrixToken( 
std::move(pMat) );
                             pNew->IncRef();
                             pStack[ sp - i ] = pNew;
                             p->DecRef();    // p may be dead now!
@@ -1564,7 +1564,7 @@ bool ScInterpreter::ConvertMatrixParameters()
                                 if (nJumpRows < nR)
                                     nJumpRows = nR;
                             }
-                            formula::FormulaToken* pNew = new ScMatrixToken( 
pMat);
+                            formula::FormulaToken* pNew = new ScMatrixToken( 
std::move(pMat) );
                             pNew->IncRef();
                             pStack[ sp - i ] = pNew;
                             p->DecRef();    // p may be dead now!
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ce52dd27bd5a..1ad3df0889ef 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -390,17 +390,17 @@ FormulaToken* ScRawToken::CreateToken(ScSheetLimits& 
rLimits) const
         case svExternalSingleRef:
             {
                 svl::SharedString aTabName(maExternalName);    // string not 
interned
-                return new ScExternalSingleRefToken(extref.nFileId, aTabName, 
extref.aRef.Ref1);
+                return new ScExternalSingleRefToken(extref.nFileId, 
std::move(aTabName), extref.aRef.Ref1);
             }
         case svExternalDoubleRef:
             {
                 svl::SharedString aTabName(maExternalName);    // string not 
interned
-                return new ScExternalDoubleRefToken(extref.nFileId, aTabName, 
extref.aRef);
+                return new ScExternalDoubleRefToken(extref.nFileId, 
std::move(aTabName), extref.aRef);
             }
         case svExternalName:
             {
                 svl::SharedString aName(maExternalName);         // string not 
interned
-                return new ScExternalNameToken( extname.nFileId, aName );
+                return new ScExternalNameToken( extname.nFileId, 
std::move(aName) );
             }
         case svJump :
             return new FormulaJumpToken( eOp, nJump );
diff --git a/sc/source/filter/excel/xeformula.cxx 
b/sc/source/filter/excel/xeformula.cxx
index d2d02a423bf9..d44e13c41935 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1398,7 +1398,7 @@ void XclExpFmlaCompImpl::ProcessFunction( const 
XclExpScToken& rTokData )
     else if( pFuncInfo->IsMacroFunc() )
         aExtFuncData.Set( pFuncInfo->GetMacroFuncName(), false, true );
 
-    XclExpFuncData aFuncData( rTokData, *pFuncInfo, aExtFuncData );
+    XclExpFuncData aFuncData( rTokData, *pFuncInfo, std::move(aExtFuncData) );
     XclExpScToken aTokData;
 
     // preparations for special functions, before function processing starts
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 1529f9920549..3bbac335d11d 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2055,7 +2055,7 @@ std::optional<SfxItemSet> ScModule::CreateItemSet( 
sal_uInt16 nId )
             aConfig.MergeDocumentSpecific( 
pDocSh->GetDocument().GetCalcConfig());
             aOptions.SetCalcConfig( aConfig);
         }
-        pRet->Put( ScTpFormulaItem( aOptions ) );
+        pRet->Put( ScTpFormulaItem( std::move(aOptions) ) );
     }
     return pRet;
 }
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 6ba63e4dc8db..7122afab9bdb 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -288,7 +288,7 @@ void ScSelectionTransferObj::CreateCellData()
                 aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
                 // maSize is set in ScTransferObj ctor
 
-                rtl::Reference<ScTransferObj> pTransferObj = new 
ScTransferObj( std::move(pClipDoc), aObjDesc );
+                rtl::Reference<ScTransferObj> pTransferObj = new 
ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) );
 
                 // SetDragHandlePos is not used - there is no mouse position
                 //? pTransferObj->SetVisibleTab( nTab );
@@ -338,7 +338,7 @@ void ScSelectionTransferObj::CreateDrawData()
             aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
             // maSize is set in ScDrawTransferObj ctor
 
-            rtl::Reference<ScDrawTransferObj> pTransferObj = new 
ScDrawTransferObj( std::move(pModel), pDocSh, aObjDesc );
+            rtl::Reference<ScDrawTransferObj> pTransferObj = new 
ScDrawTransferObj( std::move(pModel), pDocSh, std::move(aObjDesc) );
 
             SfxObjectShellRef aPersistRef( aDragShellRef.get() );
             pTransferObj->SetDrawPersist( aPersistRef );    // keep persist 
for ole objects alive
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index cfe1a1f5c6fa..057cb3e2ae35 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -712,7 +712,7 @@ ScExternalRefCache::TokenArrayRef 
ScExternalRefCache::getCellRangeData(
             if (!bFirstTab)
                 pArray->AddOpCode(ocSep);
 
-            ScMatrixToken aToken(xMat);
+            ScMatrixToken aToken(std::move(xMat));
             if (!pArray)
                 pArray = std::make_shared<ScTokenArray>(mrDoc);
             pArray->AddToken(aToken);
@@ -1645,7 +1645,7 @@ static std::unique_ptr<ScTokenArray> 
lcl_fillEmptyMatrix(const ScDocument& rDoc,
     SCSIZE nR = static_cast<SCSIZE>(rRange.aEnd.Row()-rRange.aStart.Row()+1);
     ScMatrixRef xMat = new ScMatrix(nC, nR);
 
-    ScMatrixToken aToken(xMat);
+    ScMatrixToken aToken(std::move(xMat));
     unique_ptr<ScTokenArray> pArray(new ScTokenArray(rDoc));
     pArray->AddToken(aToken);
     return pArray;
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 2c8336fd3662..29787ab6ffb7 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1139,7 +1139,7 @@ static bool lcl_DoDragObject( ScDocShell* pSrcShell, 
std::u16string_view rName,
             aObjDesc.maDisplayName = 
pSrcShell->GetMedium()->GetURLObject().GetURLNoPass();
             // maSize is set in ScDrawTransferObj ctor
 
-            rtl::Reference<ScDrawTransferObj> pTransferObj = new 
ScDrawTransferObj( std::move(pDragModel), pSrcShell, aObjDesc );
+            rtl::Reference<ScDrawTransferObj> pTransferObj = new 
ScDrawTransferObj( std::move(pDragModel), pSrcShell, std::move(aObjDesc) );
 
             pTransferObj->SetDragSourceObj( *pObject, nTab );
             pTransferObj->SetDragSourceFlags(ScDragSrc::Navigator);
@@ -1179,7 +1179,7 @@ static bool lcl_DoDragCells( ScDocShell* pSrcShell, const 
ScRange& rRange, ScDra
         aObjDesc.maDisplayName = 
pSrcShell->GetMedium()->GetURLObject().GetURLNoPass();
         // maSize is set in ScTransferObj ctor
 
-        rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( 
std::move(pClipDoc), aObjDesc );
+        rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( 
std::move(pClipDoc), std::move(aObjDesc) );
 
         pTransferObj->SetDragSource( pSrcShell, aMark );
         pTransferObj->SetDragSourceFlags( nFlags );
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx 
b/sc/source/ui/optdlg/tpdefaults.cxx
index 7a47f3dbc23a..6e4d8dcb845e 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -58,7 +58,7 @@ bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
 #if HAVE_FEATURE_JUMBO_SHEETS
         aOpt.SetInitJumboSheets( bJumboSheets );
 #endif
-        rCoreSet->Put( ScTpDefaultsItem( aOpt ) );
+        rCoreSet->Put( ScTpDefaultsItem( std::move(aOpt) ) );
         bRet = true;
     }
     return bRet;
diff --git a/sc/source/ui/optdlg/tpformula.cxx 
b/sc/source/ui/optdlg/tpformula.cxx
index f4815d17cc49..8f5855cc916f 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -314,7 +314,7 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
         aOpt.SetODFRecalcOptions(eODFRecalc);
         aOpt.SetWriteCalcConfig( maCurrentDocOptions.IsWriteCalcConfig());
 
-        rCoreSet->Put( ScTpFormulaItem( aOpt ) );
+        rCoreSet->Put( ScTpFormulaItem( std::move(aOpt) ) );
         rCoreSet->Put( ScTpCalcItem( SID_SCDOCOPTIONS, maCurrentDocOptions ) );
 
         bRet = true;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 3c8e0fa061eb..e0ccc37d5545 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1953,7 +1953,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                                                     
DefaultFontType::CJK_SPREADSHEET,
                                                     eTargetLang, 
GetDefaultFontFlags::OnlyOne );
                                 ScConversionParam aConvParam( 
SC_CONVERSION_CHINESE_TRANSL,
-                                    eSourceLang, eTargetLang, aTargetFont, 
nOptions, false );
+                                    eSourceLang, eTargetLang, 
std::move(aTargetFont), nOptions, false );
                                 pTabViewShell->DoSheetConversion( aConvParam );
                             }
                         }
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 9efc96a34e08..052c12c03857 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -92,7 +92,7 @@ void ScDrawView::BeginDrag( vcl::Window* pWindow, const 
Point& rStartPos )
     aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
     // maSize is set in ScDrawTransferObj ctor
 
-    rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( 
std::move(pModel), pDocSh, aObjDesc );
+    rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( 
std::move(pModel), pDocSh, std::move(aObjDesc) );
 
     pTransferObj->SetDrawPersist( aDragShellRef.get() );    // keep persist 
for ole objects alive
     pTransferObj->SetDragSource( this );               // copies selection
@@ -361,7 +361,7 @@ void ScDrawView::DoCopy()
     aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
     // maSize is set in ScDrawTransferObj ctor
 
-    rtl::Reference<ScDrawTransferObj> pTransferObj(new ScDrawTransferObj( 
std::move(pModel), pDocSh, aObjDesc ));
+    rtl::Reference<ScDrawTransferObj> pTransferObj(new ScDrawTransferObj( 
std::move(pModel), pDocSh, std::move(aObjDesc) ));
 
     if ( ScGlobal::xDrawClipDocShellRef.is() )
     {
@@ -395,7 +395,7 @@ uno::Reference<datatransfer::XTransferable> 
ScDrawView::CopyToTransferable()
     aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
     // maSize is set in ScDrawTransferObj ctor
 
-    rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( 
std::move(pModel), pDocSh, aObjDesc );
+    rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( 
std::move(pModel), pDocSh, std::move(aObjDesc) );
 
     if ( ScGlobal::xDrawClipDocShellRef.is() )
     {
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 3dbe74373237..772d86df1c66 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -188,7 +188,7 @@ void ScViewFunctionSet::BeginDrag()
     aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
     // maSize is set in ScTransferObj ctor
 
-    rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( 
std::move(pClipDoc), aObjDesc );
+    rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( 
std::move(pClipDoc), std::move(aObjDesc) );
 
     // set position of dragged cell within range
     ScRange aMarkRange = pTransferObj->GetRange();
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index a15b1c20e54b..94533e526f46 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -504,7 +504,7 @@ void ScTabControl::DoDrag()
     aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
     // maSize is set in ScTransferObj ctor
 
-    rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( 
std::move(pClipDoc), aObjDesc );
+    rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( 
std::move(pClipDoc), std::move(aObjDesc) );
 
     pTransferObj->SetDragSourceFlags(ScDragSrc::Table);
 
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 6f9807755d0a..215fde010694 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -293,7 +293,7 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* 
pClipDoc, const ScRangeList&
         aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
         // maSize is set in ScTransferObj ctor
 
-        rtl::Reference<ScTransferObj> pTransferObj(new ScTransferObj( 
pSysClipDoc, aObjDesc ));
+        rtl::Reference<ScTransferObj> pTransferObj(new ScTransferObj( 
pSysClipDoc, std::move(aObjDesc) ));
         if ( ScGlobal::xDrawClipDocShellRef.is() )
         {
             SfxObjectShellRef aPersistRef( 
ScGlobal::xDrawClipDocShellRef.get() );
@@ -409,7 +409,7 @@ bool ScViewFunc::CopyToClipMultiRange( const ScDocument* 
pInputClipDoc, const Sc
         aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
         // maSize is set in ScTransferObj ctor
 
-        rtl::Reference<ScTransferObj> pTransferObj(new ScTransferObj( 
std::move(pDocClip), aObjDesc ));
+        rtl::Reference<ScTransferObj> pTransferObj(new ScTransferObj( 
std::move(pDocClip), std::move(aObjDesc) ));
         if ( ScGlobal::xDrawClipDocShellRef.is() )
         {
             SfxObjectShellRef aPersistRef( 
ScGlobal::xDrawClipDocShellRef.get() );
@@ -456,7 +456,7 @@ rtl::Reference<ScTransferObj> 
ScViewFunc::CopyToTransferable()
             TransferableObjectDescriptor aObjDesc;
             pDocSh->FillTransferableObjectDescriptor( aObjDesc );
             aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
-            return new ScTransferObj( std::move(pClipDoc), aObjDesc );
+            return new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) 
);
         }
     }
 
diff --git a/sd/source/ui/animations/motionpathtag.cxx 
b/sd/source/ui/animations/motionpathtag.cxx
index ce279d8fc1de..b963d8b66a5b 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -523,7 +523,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& 
rMEvt, SmartHdl& rHdl )
 
                     // #i95646# add DragPoly as geometry to each local 
SdrDragMethod to be able
                     // to create the needed local SdrDragEntry for it in 
createSdrDragEntries()
-                    const basegfx::B2DPolyPolygon 
aDragPoly(mpPathObj->GetPathPoly());
+                    basegfx::B2DPolyPolygon 
aDragPoly(mpPathObj->GetPathPoly());
 
                     if( (pHdl->GetKind() == SdrHdlKind::Move) || 
(pHdl->GetKind() == SdrHdlKind::SmartTag) )
                     {
@@ -536,7 +536,7 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& 
rMEvt, SmartHdl& rHdl )
                     }
                     else
                     {
-                        pDragMethod = new PathDragResize( mrView, xTag, 
aDragPoly );
+                        pDragMethod = new PathDragResize( mrView, xTag, 
std::move(aDragPoly) );
                     }
 
                     mrView.BegDragObj(aMDPos, nullptr, pHdl, nDrgLog, 
pDragMethod );
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index f0664dff110e..72b3b93215dd 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -739,7 +739,7 @@ void SdPageObjsTLV::Select()
     }
 
     // object is destroyed by internal reference mechanism
-    m_xHelper.set(new SdPageObjsTLV::SdPageObjsTransferable(aBookmark, 
*pDocShell, eDragType));
+    m_xHelper.set(new 
SdPageObjsTLV::SdPageObjsTransferable(std::move(aBookmark), *pDocShell, 
eDragType));
     rtl::Reference<TransferDataContainer> xHelper(m_xHelper);
     m_xTreeView->enable_drag_source(xHelper, nDNDActions);
 }
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 8a1d8abc2022..84f5f5cc8677 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2435,7 +2435,7 @@ void SwAccessibleMap::InvalidateContent( const SwFrame 
*pFrame )
     {
         SwAccessibleEvent_Impl aEvent(
             SwAccessibleEvent_Impl::INVALID_CONTENT, pAccImpl,
-            aFrameOrObj );
+            std::move(aFrameOrObj) );
         AppendEvent( aEvent );
     }
     else
@@ -2472,7 +2472,7 @@ void SwAccessibleMap::InvalidateAttr( const SwTextFrame& 
rTextFrame )
     if( GetShell()->ActionPend() )
     {
         SwAccessibleEvent_Impl aEvent( SwAccessibleEvent_Impl::INVALID_ATTR,
-                                       pAccImpl, aFrameOrObj );
+                                       pAccImpl, std::move(aFrameOrObj) );
         aEvent.SetStates( AccessibleStates::TEXT_ATTRIBUTE_CHANGED );
         AppendEvent( aEvent );
     }
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 32d450579898..7e3f70640f77 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2725,7 +2725,7 @@ void SwEditShell::AutoFormat( const SvxSwAutoFormatFlags* 
pAFlags )
     }
     else
     {
-        SwAutoFormat aFormat( this, aAFFlags );
+        SwAutoFormat aFormat( this, std::move(aAFFlags) );
     }
 
     EndUndo( SwUndoId::AUTOFORMAT );
@@ -2770,7 +2770,7 @@ void SwEditShell::AutoFormatBySplitNode()
 
         SvxSwAutoFormatFlags aAFFlags = *GetAutoFormatFlags(); // use default 
values so far
 
-        SwAutoFormat aFormat( this, aAFFlags, &pCursor->GetMark()->nNode,
+        SwAutoFormat aFormat( this, std::move(aAFFlags), 
&pCursor->GetMark()->nNode,
                                 &pCursor->GetPoint()->nNode );
         SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
         if( pACorr && !pACorr->IsAutoCorrFlag( ACFlags::CapitalStartSentence | 
ACFlags::CapitalStartWord |
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index dca9757a1365..004e8c482e77 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1500,7 +1500,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode,
                 [&rNode](sal_Int32 const nBegin, sal_uInt16 const script, bool 
const bNoChar)
                     { return rNode.GetLang(nBegin, bNoChar ? 0 : 1, script); 
});
             auto pGetLangOfChar(pMerged ? pGetLangOfCharM : pGetLangOfChar1);
-            SwScanner aScanner( pGetLangOfChar, rText, nullptr, 
ModelToViewHelper(),
+            SwScanner aScanner( std::move(pGetLangOfChar), rText, nullptr, 
ModelToViewHelper(),
                                 i18n::WordType::DICTIONARY_WORD,
                                 sal_Int32(nLastKashida), sal_Int32(nChg));
 
diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index ed7f4b848945..89294319b0ee 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -791,7 +791,7 @@ SwFieldType* SwXFieldMaster::GetFieldType(bool const 
bDontCreate) const
         aData.sCommand = m_pImpl->m_sParam2;
         aData.nCommandType = m_pImpl->m_nParam2;
 
-        SwDBFieldType aType(m_pImpl->m_pDoc, m_pImpl->m_sParam3, aData);
+        SwDBFieldType aType(m_pImpl->m_pDoc, m_pImpl->m_sParam3, 
std::move(aData));
         SwFieldType *const pType = 
m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
         m_pImpl->SetFieldType(pType);
     }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 58d0a5bd4995..ae0a53e8056a 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3361,7 +3361,7 @@ void AttributeOutputBase::TextFlyContent( const 
SwFormatFlyCnt& rFlyContent )
         Point aLayPos = pTextNd->FindLayoutRect( false, &origin ).Pos();
 
         SwPosition aPos( *pTextNd );
-        ww8::Frame aFrame( *rFlyContent.GetFrameFormat(), aPos );
+        ww8::Frame aFrame( *rFlyContent.GetFrameFormat(), std::move(aPos) );
 
         OutputFlyFrame_Impl( aFrame, aLayPos );
     }
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index da4b0473f4ad..4cfc25736250 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -648,7 +648,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const 
SwTableLines& rLines,
         SwFrameFormat *pFrameFormat = pLine->GetFrameFormat();
         if (auto oNew = rExpRows.AddRow(*pFrameFormat, rNamePrefix, nLine))
         {
-            ExportFormat(*pFrameFormat, XML_TABLE_ROW, oNew);
+            ExportFormat(*pFrameFormat, XML_TABLE_ROW, std::move(oNew));
         }
 
         const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
@@ -679,7 +679,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const 
SwTableLines& rLines,
                 if (auto oNew = rExpCells.AddCell(*pFrameFormat2, rNamePrefix, 
nOldCol, nLine,
                                        bTop) )
                 {
-                    ExportFormat(*pFrameFormat2, XML_TABLE_CELL, oNew);
+                    ExportFormat(*pFrameFormat2, XML_TABLE_CELL, 
std::move(oNew));
                 }
 
                 Reference < XCell > xCell = SwXCell::CreateXCell(
diff --git a/sw/source/filter/xml/xmltexti.cxx 
b/sw/source/filter/xml/xmltexti.cxx
index 448ea1b79043..586f23873ce9 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -618,7 +618,7 @@ uno::Reference< XPropertySet > 
SwXMLTextImportHelper::createAndInsertApplet(
     SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END> aItemSet( 
pDoc->GetAttrPool() );
     lcl_putHeightAndWidth( aItemSet, nHeight, nWidth);
 
-    SwApplet_Impl aAppletImpl ( aItemSet );
+    SwApplet_Impl aAppletImpl ( std::move(aItemSet) );
 
     OUString sCodeBase;
     if( !rHRef.isEmpty() )
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index c6d7afd3c719..b0264080de00 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -1459,7 +1459,7 @@ void globalTransfer_(
                         rContext.xProcessor,
                         rContext.xEnv,
                         rContext.xOrigEnv,
-                        aTransArg );
+                        std::move(aTransArg) );
                 do
                 {
                     uno::Reference< ucb::XContent > xChild
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx 
b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index b3f5366377fd..61a495267814 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -91,7 +91,7 @@ rtl::Reference<HierarchyContent> HierarchyContent::create(
     if ( !loadData( rxContext, pProvider, Identifier, aProps ) )
         return nullptr;
 
-    return new HierarchyContent( rxContext, pProvider, Identifier, aProps );
+    return new HierarchyContent( rxContext, pProvider, Identifier, 
std::move(aProps) );
 }
 
 
diff --git a/ucb/source/ucp/package/pkgcontent.cxx 
b/ucb/source/ucp/package/pkgcontent.cxx
index 6e9961019e15..8bf7e4bc2873 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -169,7 +169,7 @@ rtl::Reference<Content> Content::create(
 
         uno::Reference< ucb::XContentIdentifier > xId
             = new ::ucbhelper::ContentIdentifier( aURI.getUri() );
-        return new Content( rxContext, pProvider, xId, xPackage, aURI, aProps 
);
+        return new Content( rxContext, pProvider, xId, xPackage, aURI, 
std::move(aProps) );
     }
     else
     {
@@ -218,7 +218,7 @@ rtl::Reference<Content> Content::create(
 
     uno::Reference< ucb::XContentIdentifier > xId
         = new ::ucbhelper::ContentIdentifier( aURI.getUri() );
-    return new Content( rxContext, pProvider, xId, xPackage, aURI, Info );
+    return new Content( rxContext, pProvider, xId, xPackage, std::move(aURI), 
Info );
 }
 
 
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx 
b/ucb/source/ucp/tdoc/tdoc_content.cxx
index ea695c7b0dbb..b956695eab75 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -117,7 +117,7 @@ rtl::Reference<Content> Content::create(
                              aProps ) )
         return nullptr;
 
-    return new Content( rxContext, pProvider, Identifier, aProps );
+    return new Content( rxContext, pProvider, Identifier, std::move(aProps) );
 }
 
 

Reply via email to