chart2/source/controller/main/ObjectHierarchy.cxx    |    2 +-
 comphelper/source/misc/mimeconfighelper.cxx          |    2 +-
 cui/source/customize/SvxNotebookbarConfigPage.cxx    |    2 +-
 docmodel/source/color/ComplexColorJSON.cxx           |    2 +-
 sfx2/source/bastyp/fltfnc.cxx                        |   14 ++++++--------
 svx/source/sdr/primitive2d/sdrattributecreator.cxx   |    5 +++--
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |    2 +-
 ucb/source/ucp/package/pkgcontent.cxx                |    4 ++--
 vcl/inc/widgetdraw/WidgetDefinitionReader.hxx        |    2 +-
 vcl/source/filter/svm/SvmConverter.cxx               |    2 +-
 vcl/source/font/FeatureCollector.cxx                 |    2 +-
 vcl/source/gdi/WidgetDefinitionReader.cxx            |    2 +-
 vcl/source/graphic/UnoGraphicProvider.cxx            |    2 +-
 vcl/source/window/window.cxx                         |    7 ++-----
 14 files changed, 23 insertions(+), 27 deletions(-)

New commits:
commit 2f81046033bb4082f888edfa94685d2dcc2689aa
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Jul 16 08:29:53 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Jul 16 15:13:41 2024 +0200

    cid#1554709 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1554745 COPY_INSTEAD_OF_MOVE
    cid#1554758 COPY_INSTEAD_OF_MOVE
    cid#1554766 COPY_INSTEAD_OF_MOVE
    cid#1554771 COPY_INSTEAD_OF_MOVE
    cid#1554787 COPY_INSTEAD_OF_MOVE
    cid#1554802 COPY_INSTEAD_OF_MOVE
    cid#1554820 COPY_INSTEAD_OF_MOVE
    cid#1554828 COPY_INSTEAD_OF_MOVE
    cid#1554829 COPY_INSTEAD_OF_MOVE
    cid#1554832 COPY_INSTEAD_OF_MOVE
    cid#1554842 COPY_INSTEAD_OF_MOVE
    cid#1554885 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I43ec20250a04dc087f3d7fdeafc75f0c1dd0de25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170542
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx 
b/chart2/source/controller/main/ObjectHierarchy.cxx
index 5cf427133a9e..7f5b87d1fb6d 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -400,7 +400,7 @@ void ObjectHierarchy::createDataSeriesTree(
                     }
 
                     if( ! aSeriesSubContainer.empty())
-                        m_aChildMap[ aSeriesOID ] = aSeriesSubContainer;
+                        m_aChildMap[ aSeriesOID ] = 
std::move(aSeriesSubContainer);
                 }
             }
         }
diff --git a/comphelper/source/misc/mimeconfighelper.cxx 
b/comphelper/source/misc/mimeconfighelper.cxx
index dfd7fa53f677..b648b987cbb7 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -277,7 +277,7 @@ bool MimeConfigurationHelper::GetVerbByShortcut( const 
OUString& aVerbShortcut,
               && ( xVerbsProps->getByName(sVerbFlags) >>= aTempDescr.VerbFlags 
)
               && ( xVerbsProps->getByName(sVerbAttributes) >>= 
aTempDescr.VerbAttributes ) )
             {
-                aDescriptor = aTempDescr;
+                aDescriptor = std::move(aTempDescr);
                 bResult = true;
             }
         }
diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx 
b/cui/source/customize/SvxNotebookbarConfigPage.cxx
index a503e4312e9d..da4df844336f 100644
--- a/cui/source/customize/SvxNotebookbarConfigPage.cxx
+++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx
@@ -316,7 +316,7 @@ void 
SvxNotebookbarConfigPage::searchNodeandAttribute(std::vector<NotebookbarEnt
                               + " | " + sUIItemId;
                     }
                     aCategoryList.push_back(aCategoryEntry);
-                    aCurItemEntry = aCategoryEntry;
+                    aCurItemEntry = std::move(aCategoryEntry);
                 }
                 else if (sClassId == "svtlo-ManagedMenuButton")
                 {
diff --git a/docmodel/source/color/ComplexColorJSON.cxx 
b/docmodel/source/color/ComplexColorJSON.cxx
index a2a683acfb89..7d5688d84af5 100644
--- a/docmodel/source/color/ComplexColorJSON.cxx
+++ b/docmodel/source/color/ComplexColorJSON.cxx
@@ -56,7 +56,7 @@ bool convertFromJSON(OString const& rJsonString, 
model::ComplexColor& rComplexCo
         return false;
     }
 
-    rComplexColor = aComplexColor;
+    rComplexColor = std::move(aComplexColor);
     return true;
 }
 
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index a304e7a9494d..547364c84fe4 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -487,22 +487,20 @@ ErrCode SfxFilterMatcher::DetectFilter( SfxMedium& 
rMedium, std::shared_ptr<cons
  */
 
 {
-    std::shared_ptr<const SfxFilter> pOldFilter = rMedium.GetFilter();
-    if ( pOldFilter )
+    std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter();
+    if ( pFilter )
     {
-        if( !IsFilterInstalled_Impl( pOldFilter ) )
-            pOldFilter = nullptr;
+        if( !IsFilterInstalled_Impl( pFilter ) )
+            pFilter = nullptr;
         else
         {
             const SfxStringItem* pSalvageItem = 
rMedium.GetItemSet().GetItem(SID_DOC_SALVAGE, false);
-            if ( ( pOldFilter->GetFilterFlags() & SfxFilterFlags::PACKED ) && 
pSalvageItem )
+            if ( ( pFilter->GetFilterFlags() & SfxFilterFlags::PACKED ) && 
pSalvageItem )
                 // Salvage is always done without packing
-                pOldFilter = nullptr;
+                pFilter = nullptr;
         }
     }
 
-    std::shared_ptr<const SfxFilter> pFilter = pOldFilter;
-
     bool bPreview = rMedium.IsPreview_Impl();
     const SfxStringItem* pReferer = rMedium.GetItemSet().GetItem(SID_REFERER, 
false);
     if ( bPreview && rMedium.IsRemote() && ( !pReferer || 
!pReferer->GetValue().match("private:searchfolder:") ) )
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx 
b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 6b18b2fab1de..54659137d7a2 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -880,7 +880,7 @@ namespace drawinglayer::primitive2d
             attribute::FillGradientAttribute aFillFloatTransGradient;
 
             // try line style
-            const attribute::SdrLineAttribute 
aLine(createNewSdrLineAttribute(rSet));
+            attribute::SdrLineAttribute aLine(createNewSdrLineAttribute(rSet));
 
             if(!aLine.isDefault())
             {
@@ -906,7 +906,8 @@ namespace drawinglayer::primitive2d
                 aShadow = createNewSdrShadowAttribute(rSet);
 
                 return attribute::SdrLineFillShadowAttribute3D(
-                    aLine, aFill, aLineStartEnd, aShadow, 
aFillFloatTransGradient);
+                    std::move(aLine), std::move(aFill), 
std::move(aLineStartEnd),
+                    std::move(aShadow), std::move(aFillFloatTransGradient));
             }
 
             return attribute::SdrLineFillShadowAttribute3D();
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 10b48f851443..cd3588270162 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -892,7 +892,7 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
                 return std::move(rContent);
             Primitive2DContainer aRetval(2);
             aRetval[0] = new GlowPrimitive2D(rGlow.getColor(), 
rGlow.getRadius(), Primitive2DContainer(rContent));
-            aRetval[1] = new GroupPrimitive2D(Primitive2DContainer(rContent));
+            aRetval[1] = new 
GroupPrimitive2D(Primitive2DContainer(std::move(rContent)));
             return aRetval;
         }
 
diff --git a/ucb/source/ucp/package/pkgcontent.cxx 
b/ucb/source/ucp/package/pkgcontent.cxx
index ecf91d57bbfd..aac57a638d7e 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, 
std::move(aProps) );
+        return new Content( rxContext, pProvider, xId, xPackage, 
std::move(aURI), std::move(aProps) );
     }
     else
     {
@@ -191,7 +191,7 @@ rtl::Reference<Content> Content::create(
         else
             aInfo.Type = getContentType( aURI.getScheme(), false );
 
-        return new Content( rxContext, pProvider, xId, xPackage, aURI, aInfo );
+        return new Content( rxContext, pProvider, xId, xPackage, 
std::move(aURI), std::move(aInfo) );
     }
 }
 
diff --git a/vcl/inc/widgetdraw/WidgetDefinitionReader.hxx 
b/vcl/inc/widgetdraw/WidgetDefinitionReader.hxx
index c0c806839092..5a9bbac76d4c 100644
--- a/vcl/inc/widgetdraw/WidgetDefinitionReader.hxx
+++ b/vcl/inc/widgetdraw/WidgetDefinitionReader.hxx
@@ -28,7 +28,7 @@ private:
                                        WidgetDefinition& rWidgetDefinition, 
ControlType eType);
 
     SAL_DLLPRIVATE void readPart(tools::XmlWalker& rWalker,
-                                 std::shared_ptr<WidgetDefinitionPart> rpPart);
+                                 const std::shared_ptr<WidgetDefinitionPart>& 
rpPart);
 
     SAL_DLLPRIVATE void
     readDrawingDefinition(tools::XmlWalker& rWalker,
diff --git a/vcl/source/filter/svm/SvmConverter.cxx 
b/vcl/source/filter/svm/SvmConverter.cxx
index 0e9277dc9240..d14adcc30640 100644
--- a/vcl/source/filter/svm/SvmConverter.cxx
+++ b/vcl/source/filter/svm/SvmConverter.cxx
@@ -643,7 +643,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, 
GDIMetaFile& rMtf )
                     else
                     {
                         nLastPolygonAction = rMtf.GetActionSize();
-                        rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) 
);
+                        rMtf.AddAction(new 
MetaPolyPolygonAction(std::move(aPolyPoly)));
                     }
                 }
             }
diff --git a/vcl/source/font/FeatureCollector.cxx 
b/vcl/source/font/FeatureCollector.cxx
index 8d53af174a0c..3e8e2e76e8a5 100644
--- a/vcl/source/font/FeatureCollector.cxx
+++ b/vcl/source/font/FeatureCollector.cxx
@@ -181,7 +181,7 @@ void FeatureCollector::collectForTable(hb_tag_t aTableTag)
         }
 
         if (aDefinition)
-            rFeature.m_aDefinition = aDefinition;
+            rFeature.m_aDefinition = std::move(aDefinition);
     }
 }
 
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx 
b/vcl/source/gdi/WidgetDefinitionReader.cxx
index cb5d3a83828f..16c588883262 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -332,7 +332,7 @@ void 
WidgetDefinitionReader::readDefinition(tools::XmlWalker& rWalker,
 }
 
 void WidgetDefinitionReader::readPart(tools::XmlWalker& rWalker,
-                                      std::shared_ptr<WidgetDefinitionPart> 
rpPart)
+                                      const 
std::shared_ptr<WidgetDefinitionPart>& rpPart)
 {
     rWalker.children();
     while (rWalker.isValid())
diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx 
b/vcl/source/graphic/UnoGraphicProvider.cxx
index d472aaaadcfd..aa92b2f50b28 100644
--- a/vcl/source/graphic/UnoGraphicProvider.cxx
+++ b/vcl/source/graphic/UnoGraphicProvider.cxx
@@ -411,7 +411,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL 
GraphicProvider::queryGraphic( co
             {
                 Graphic aGraphic = rFilter.ImportUnloadedGraphic(*pIStm);
                 if (!aGraphic.IsNone())
-                    aVCLGraphic = aGraphic;
+                    aVCLGraphic = std::move(aGraphic);
             }
             if (aVCLGraphic.IsNone())
                 error = rFilter.ImportGraphic(aVCLGraphic, aPath, *pIStm, 
GRFILTER_FORMAT_DONTKNOW, nullptr, GraphicFilterImportFlags::NONE);
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index dcb68b9cf142..108ad423454c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1758,8 +1758,6 @@ void Window::ImplNewInputContext()
     SalInputContext         aNewContext;
     const vcl::Font&        rFont = rInputContext.GetFont();
     const OUString&         rFontName = rFont.GetFamilyName();
-    rtl::Reference<LogicalFontInstance> pFontInstance;
-    aNewContext.mpFont = nullptr;
     if (!rFontName.isEmpty())
     {
         OutputDevice *pFocusWinOutDev = pFocusWin->GetOutDev();
@@ -1773,11 +1771,10 @@ void Window::ImplNewInputContext()
             else
                 aSize.setHeight( (12*pFocusWin->GetOutDev()->mnDPIY)/72 );
         }
-        pFontInstance = pFocusWin->GetOutDev()->mxFontCache->GetFontInstance(
+        aNewContext.mpFont =
+                        pFocusWin->GetOutDev()->mxFontCache->GetFontInstance(
                             pFocusWin->GetOutDev()->mxFontCollection.get(),
                             rFont, aSize, static_cast<float>(aSize.Height()) );
-        if ( pFontInstance )
-            aNewContext.mpFont = pFontInstance;
     }
     aNewContext.mnOptions   = rInputContext.GetOptions();
     pFocusWin->ImplGetFrame()->SetInputContext( &aNewContext );

Reply via email to