sc/source/filter/excel/excel.cxx        |    4 ++--
 sc/source/ui/app/seltrans.cxx           |   10 +++++-----
 sc/source/ui/view/tabvwsha.cxx          |   28 ++++++++++++++--------------
 svx/source/tbxctrls/fontworkgallery.cxx |   18 +++++++++---------
 sw/source/core/undo/SwRewriter.cxx      |    2 +-
 vcl/source/gdi/print.cxx                |    2 +-
 6 files changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 7e48cbfcef0b81fc9bf9bea5ddf1b4d01e5ea7a2
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Jul 14 14:22:53 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Jul 15 10:09:07 2024 +0200

    cid#1607327 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1554706 COPY_INSTEAD_OF_MOVE
    cid#1554733 COPY_INSTEAD_OF_MOVE
    cid#1554736 COPY_INSTEAD_OF_MOVE
    cid#1554738 COPY_INSTEAD_OF_MOVE
    cid#1554740 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I766cff4ef8eb4256d26f51d7d9dc64442c4bc728
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170453
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 44fe3b31a0b1..1bd34e27e43d 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -206,14 +206,14 @@ ErrCode ScFormatFilterPluginImpl::ScImportExcel( 
SfxMedium& rMedium, ScDocument*
         {
             /*  Only "Workbook" stream exists; or both streams exist,
                 and "Workbook" has higher BIFF version than "Book" stream. */
-            xStrgStrm = xWorkbookStrm;
+            xStrgStrm = std::move(xWorkbookStrm);
             eBiff = eWorkbookBiff;
         }
         else if( eBookBiff != EXC_BIFF_UNKNOWN )
         {
             /*  Only "Book" stream exists; or both streams exist,
                 and "Book" has higher BIFF version than "Workbook" stream. */
-            xStrgStrm = xBookStrm;
+            xStrgStrm = std::move(xBookStrm);
             eBiff = eBookBiff;
         }
 
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 208b87528b31..e7ffa1c42869 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -288,16 +288,16 @@ void ScSelectionTransferObj::CreateCellData()
                 aObjDesc.maDisplayName = 
pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
                 // maSize is set in ScTransferObj ctor
 
-                rtl::Reference<ScTransferObj> pTransferObj = new 
ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) );
+                rtl::Reference<ScTransferObj> xTransferObj = new 
ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) );
 
                 // SetDragHandlePos is not used - there is no mouse position
-                //? pTransferObj->SetVisibleTab( nTab );
+                //? xTransferObj->SetVisibleTab( nTab );
 
-                pTransferObj->SetDrawPersist(aDragShellRef); // keep persist 
for ole objects alive
+                xTransferObj->SetDrawPersist(aDragShellRef); // keep persist 
for ole objects alive
 
-                pTransferObj->SetDragSource( pDocSh, aNewMark );
+                xTransferObj->SetDragSource( pDocSh, aNewMark );
 
-                mxCellData = pTransferObj;
+                mxCellData = std::move(xTransferObj);
             }
         }
     }
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index dc08fa8b9046..26da7af3a483 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -550,11 +550,11 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& 
rReq, const OUString &rNam
 
     const ScPatternAttr*    pOldAttrs       = GetSelectionPattern();
 
-    auto pOldSet = std::make_shared<SfxItemSet>(pOldAttrs->GetItemSet());
+    auto xOldSet = std::make_shared<SfxItemSet>(pOldAttrs->GetItemSet());
 
-    pOldSet->MergeRange(XATTR_FILLSTYLE, XATTR_FILLCOLOR);
+    xOldSet->MergeRange(XATTR_FILLSTYLE, XATTR_FILLCOLOR);
 
-    pOldSet->MergeRange(SID_ATTR_BORDER_STYLES, SID_ATTR_BORDER_DEFAULT_WIDTH);
+    xOldSet->MergeRange(SID_ATTR_BORDER_STYLES, SID_ATTR_BORDER_DEFAULT_WIDTH);
 
     // We only allow these border line types.
     std::vector<sal_Int32> aBorderStyles{
@@ -566,11 +566,11 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& 
rReq, const OUString &rNam
         table::BorderLineStyle::DASH_DOT_DOT,
         table::BorderLineStyle::DOUBLE_THIN };
 
-    pOldSet->Put(SfxIntegerListItem(SID_ATTR_BORDER_STYLES, 
std::move(aBorderStyles)));
+    xOldSet->Put(SfxIntegerListItem(SID_ATTR_BORDER_STYLES, 
std::move(aBorderStyles)));
 
     // Set the default border width to 0.75 points.
     SfxInt64Item aBorderWidthItem(SID_ATTR_BORDER_DEFAULT_WIDTH, 75);
-    pOldSet->Put(aBorderWidthItem);
+    xOldSet->Put(aBorderWidthItem);
 
     // Get border items and put them in the set:
     GetSelectionFrame( aLineOuter, aLineInner );
@@ -589,27 +589,27 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& 
rReq, const OUString &rNam
         aLineInner->SetValid( SvxBoxInfoItemValidFlags::LEFT, 
aTempInfo->IsValid(SvxBoxInfoItemValidFlags::RIGHT));
         aLineInner->SetValid( SvxBoxInfoItemValidFlags::RIGHT, 
aTempInfo->IsValid(SvxBoxInfoItemValidFlags::LEFT));
 
-        pOldSet->Put( std::move(aNewFrame) );
+        xOldSet->Put( std::move(aNewFrame) );
     }
     else
     {
-        pOldSet->Put( *aLineOuter );
+        xOldSet->Put( *aLineOuter );
     }
 
-    pOldSet->Put( *aLineInner );
+    xOldSet->Put( *aLineInner );
 
     // Generate NumberFormat Value from Value and Language and box it.
-    pOldSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT,
+    xOldSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT,
         pOldAttrs->GetNumberFormat( rDoc.GetFormatTable() ) ) );
 
     std::unique_ptr<SvxNumberInfoItem> pNumberInfoItem = 
MakeNumberInfoItem(rDoc, GetViewData());
-    pOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, 
SID_ATTR_NUMBERFORMAT_INFO );
-    pOldSet->Put( std::move(pNumberInfoItem) );
+    xOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, 
SID_ATTR_NUMBERFORMAT_INFO );
+    xOldSet->Put( std::move(pNumberInfoItem) );
 
     bInFormatDialog = true;
     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-    VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScAttrDlg(GetFrameWeld(), 
pOldSet.get()));
+    VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScAttrDlg(GetFrameWeld(), 
xOldSet.get()));
 
     if (!rName.isEmpty())
         pDlg->SetCurPageId(rName);
@@ -617,7 +617,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, 
const OUString &rNam
     auto xRequest = std::make_shared<SfxRequest>(rReq);
     rReq.Ignore(); // the 'old' request is not relevant any more
 
-    pDlg->StartExecuteAsync([pDlg, pOldSet, xRequest=std::move(xRequest), 
this](sal_Int32 nResult){
+    pDlg->StartExecuteAsync([pDlg, xOldSet=std::move(xOldSet), 
xRequest=std::move(xRequest), this](sal_Int32 nResult){
         bInFormatDialog = false;
 
         if ( nResult == RET_OK )
@@ -628,7 +628,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, 
const OUString &rNam
                 UpdateNumberFormatter(*pItem);
             }
 
-            ApplyAttributes(*pOutSet, *pOldSet);
+            ApplyAttributes(*pOutSet, *xOldSet);
 
             xRequest->Done(*pOutSet);
         }
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index c7cbec22e647..7cbf3479f4b5 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -191,7 +191,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
         return;
 
     // Clone directly to target SdrModel (may be different due to user/caller 
(!))
-    rtl::Reference<SdrObject> pNewObject(
+    rtl::Reference<SdrObject> xNewObject(
         pPage->GetObj(0)->CloneSdrObject(
             bUseSpecialCalcMode ? *mpDestModel : 
mrSdrView.getSdrModelFromSdrView()));
 
@@ -203,11 +203,11 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
     if (aModuleIdentifier != "com.sun.star.drawing.DrawingDocument"  &&
         aModuleIdentifier != "com.sun.star.presentation.PresentationDocument" )
     {
-        pNewObject->SetName(SvxResId(STR_ObjNameSingulFONTWORK) + u" 1");
-        pNewObject->MakeNameUnique();
+        xNewObject->SetName(SvxResId(STR_ObjNameSingulFONTWORK) + u" 1");
+        xNewObject->MakeNameUnique();
     }
     else
-        pNewObject->SetName(OUString());
+        xNewObject->SetName(OUString());
 
     // tdf#117629
     // Since the 'old' ::CloneSdrObject also copies the SdrPage* the
@@ -219,9 +219,9 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
     // TTTT: This also *might* be the hidden reason for the strange code at the
     // end of SdrObject::SetPage that tries to delete the SvxShape under some
     // circumstances...
-    // pNewObject->SetPage(nullptr);
+    // xNewObject->SetPage(nullptr);
 
-    tools::Rectangle aObjRect( pNewObject->GetLogicRect() );
+    tools::Rectangle aObjRect( xNewObject->GetLogicRect() );
     Point aPagePos;
     Size aFontworkSize = aObjRect.GetSize();
 
@@ -254,11 +254,11 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
         aPagePos.AdjustY( -(aFontworkSize.getHeight() / 2) );
 
     tools::Rectangle aNewObjectRectangle(aPagePos, aFontworkSize);
-    pNewObject->SetLogicRect(aNewObjectRectangle);
+    xNewObject->SetLogicRect(aNewObjectRectangle);
 
     if (bUseSpecialCalcMode)
     {
-        mxSdrObject = pNewObject;
+        mxSdrObject = std::move(xNewObject);
     }
     else
     {
@@ -266,7 +266,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
 
         if (nullptr != pPV)
         {
-            mrSdrView.InsertObjectAtView( pNewObject.get(), *pPV );
+            mrSdrView.InsertObjectAtView( xNewObject.get(), *pPV );
         }
     }
 }
diff --git a/sw/source/core/undo/SwRewriter.cxx 
b/sw/source/core/undo/SwRewriter.cxx
index 6a656510097c..bdc9a4c1b06d 100644
--- a/sw/source/core/undo/SwRewriter.cxx
+++ b/sw/source/core/undo/SwRewriter.cxx
@@ -31,7 +31,7 @@ void SwRewriter::AddRule(SwUndoArg eWhat, const OUString& 
rWith)
                   [&aRule](SwRewriteRule const& a) { return a.first == 
aRule.first; });
 
     if (aIt != mRules.end())
-        *aIt = aRule;
+        *aIt = std::move(aRule);
     else
         mRules.push_back(aRule);
 }
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index b2f821613ba4..6dc7584c9add 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1441,7 +1441,7 @@ void Printer::SetDuplexMode( DuplexMode eDuplex )
     {
         ImplUpdateJobSetupPaper( aJobSetup );
         mbNewJobSetup = true;
-        maJobSetup = aJobSetup;
+        maJobSetup = std::move(aJobSetup);
         ImplUpdatePageData();
         ImplUpdateFontList();
     }

Reply via email to