include/vcl/glyphitemcache.hxx                       |    4 -
 sc/inc/fstalgorithm.hxx                              |    3 -
 sdext/source/pdfimport/pdfparse/pdfparse.cxx         |   42 +++++++++----------
 sfx2/source/doc/docfile.cxx                          |    3 -
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |    3 -
 svx/source/tbxctrls/PaletteManager.cxx               |    3 -
 sw/source/core/unocore/unostyle.cxx                  |    3 -
 sw/source/uibase/shells/textsh1.cxx                  |    2 
 ucb/source/ucp/cmis/cmis_content.cxx                 |    3 -
 vcl/source/font/FeatureCollector.cxx                 |    6 +-
 vcl/source/gdi/impglyphitem.cxx                      |    7 +--
 11 files changed, 37 insertions(+), 42 deletions(-)

New commits:
commit 20c015f2726904b0d96380a1ec16e7d7406acca1
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Dec 31 20:20:00 2023 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Dec 31 23:08:51 2023 +0100

    cid#1546464 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1546346 COPY_INSTEAD_OF_MOVE
    cid#1546342 COPY_INSTEAD_OF_MOVE
    cid#1546320 COPY_INSTEAD_OF_MOVE
    cid#1546305 COPY_INSTEAD_OF_MOVE
    cid#1546241 COPY_INSTEAD_OF_MOVE
    cid#1546162 COPY_INSTEAD_OF_MOVE
    cid#1546118 COPY_INSTEAD_OF_MOVE
    cid#1546048 COPY_INSTEAD_OF_MOVE
    cid#1545989 COPY_INSTEAD_OF_MOVE
    cid#1545936 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I63bc43378b36f7c49e66231152138ad7038971e1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161507
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx
index 0dc15d82f6f1..e0cadb7e7c13 100644
--- a/include/vcl/glyphitemcache.hxx
+++ b/include/vcl/glyphitemcache.hxx
@@ -43,13 +43,13 @@ class VCL_DLLPUBLIC SalLayoutGlyphsCache final
 public:
     // NOTE: The lifetime of the returned value is guaranteed only until the 
next call
     // to any function in this class.
-    const SalLayoutGlyphs* GetLayoutGlyphs(VclPtr<const OutputDevice> 
outputDevice,
+    const SalLayoutGlyphs* GetLayoutGlyphs(const VclPtr<const OutputDevice>& 
outputDevice,
                                            const OUString& text,
                                            const vcl::text::TextLayoutCache* 
layoutCache = nullptr)
     {
         return GetLayoutGlyphs(outputDevice, text, 0, text.getLength(), 0, 
layoutCache);
     }
-    const SalLayoutGlyphs* GetLayoutGlyphs(VclPtr<const OutputDevice> 
outputDevice,
+    const SalLayoutGlyphs* GetLayoutGlyphs(const VclPtr<const OutputDevice>& 
outputDevice,
                                            const OUString& text, sal_Int32 
nIndex, sal_Int32 nLen,
                                            tools::Long nLogicWidth = 0,
                                            const vcl::text::TextLayoutCache* 
layoutCache = nullptr);
diff --git a/sc/inc/fstalgorithm.hxx b/sc/inc/fstalgorithm.hxx
index 7db039fd0905..6cd67c8cf7dd 100644
--- a/sc/inc/fstalgorithm.hxx
+++ b/sc/inc/fstalgorithm.hxx
@@ -117,8 +117,7 @@ std::vector<Span> toSpanArray( const 
mdds::flat_segment_tree<Key,bool>& rTree, K
         // Tree search failed.
         return aSpans;
 
-    typename FstType::const_iterator it = r.first, itEnd = rTree.end();
-    buildSpan<Key,Span>(aSpans, it, itEnd, &nStartPos);
+    buildSpan<Key,Span>(aSpans, r.first, rTree.end(), &nStartPos);
     return aSpans;
 }
 
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx 
b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index 8b3da7eb39d7..1a78fde79de1 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -284,12 +284,12 @@ public:
     }
     #endif
 
-    static void parseError( const char* pMessage, iteratorT pLocation )
+    static void parseError( const char* pMessage, const iteratorT& pLocation )
     {
         throw_( pLocation, pMessage );
     }
 
-    OString iteratorToString( iteratorT first, iteratorT last ) const
+    OString iteratorToString( iteratorT first, const iteratorT& last ) const
     {
         OStringBuffer aStr( 32 );
         while( first != last )
@@ -300,7 +300,7 @@ public:
         return aStr.makeStringAndClear();
     }
 
-    void haveFile( iteratorT pBegin, SAL_UNUSED_PARAMETER iteratorT /*pEnd*/ )
+    void haveFile( const iteratorT& pBegin, SAL_UNUSED_PARAMETER iteratorT 
/*pEnd*/ )
     {
         if( m_aObjectStack.empty() )
         {
@@ -315,7 +315,7 @@ public:
             parseError( "found file header in unusual place", pBegin );
     }
 
-    void pushComment( iteratorT first, iteratorT last )
+    void pushComment(const iteratorT& first, const iteratorT& last)
     {
         // add a comment to the current stack element
         PDFComment* pComment =
@@ -328,7 +328,7 @@ public:
         pContainer->m_aSubElements.emplace_back( pComment );
     }
 
-    void insertNewValue( std::unique_ptr<PDFEntry> pNewValue, iteratorT pPos )
+    void insertNewValue( std::unique_ptr<PDFEntry> pNewValue, const iteratorT& 
pPos )
     {
         PDFContainer* pContainer = nullptr;
         const char* pMsg = nullptr;
@@ -384,33 +384,32 @@ public:
         }
     }
 
-    void pushName( iteratorT first, iteratorT last )
+    void pushName(const iteratorT& first, const iteratorT& last )
     {
         insertNewValue( 
std::make_unique<PDFName>(iteratorToString(first,last)), first );
     }
 
-    void pushDouble( iteratorT first, SAL_UNUSED_PARAMETER iteratorT /*last*/ )
+    void pushDouble( const iteratorT& first, SAL_UNUSED_PARAMETER const 
iteratorT& /*last*/ )
     {
         insertNewValue( std::make_unique<PDFNumber>(m_fDouble), first );
     }
 
-    void pushString( iteratorT first, iteratorT last )
+    void pushString( const iteratorT& first, const iteratorT& last )
     {
         insertNewValue( 
std::make_unique<PDFString>(iteratorToString(first,last)), first );
     }
 
-    void pushBool( iteratorT first, iteratorT last )
+    void pushBool( const iteratorT& first, const iteratorT& last )
     {
         insertNewValue( std::make_unique<PDFBool>( last-first == 4 ), first );
     }
 
-    void pushNull( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void pushNull( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         insertNewValue( std::make_unique<PDFNull>(), first );
     }
 
-
-    void beginObject( iteratorT first, SAL_UNUSED_PARAMETER iteratorT /*last*/ 
)
+    void beginObject( const iteratorT& first, SAL_UNUSED_PARAMETER const 
iteratorT& /*last*/ )
     {
         if( m_aObjectStack.empty() )
             m_aObjectStack.push_back( new PDFPart() );
@@ -435,7 +434,7 @@ public:
             parseError( "object in wrong place", first );
     }
 
-    void endObject( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void endObject( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         if( m_aObjectStack.empty() )
             parseError( "endobj without obj", first );
@@ -445,7 +444,7 @@ public:
             m_aObjectStack.pop_back();
     }
 
-    void pushObjectRef( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void pushObjectRef( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT 
)
     {
         unsigned int nGeneration = m_aUIntStack.back();
         m_aUIntStack.pop_back();
@@ -454,7 +453,7 @@ public:
         insertNewValue( std::make_unique<PDFObjectRef>(nObject,nGeneration), 
first );
     }
 
-    void beginDict( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void beginDict( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         PDFDict* pDict = new PDFDict();
         pDict->m_nOffset = first - m_aGlobalBegin;
@@ -463,7 +462,8 @@ public:
         // will not come here if insertion fails (exception)
         m_aObjectStack.push_back( pDict );
     }
-    void endDict( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+
+    void endDict( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         PDFDict* pDict = nullptr;
         if( m_aObjectStack.empty() )
@@ -484,7 +484,7 @@ public:
         }
     }
 
-    void beginArray( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void beginArray( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         PDFArray* pArray = new PDFArray();
         pArray->m_nOffset = first - m_aGlobalBegin;
@@ -494,7 +494,7 @@ public:
         m_aObjectStack.push_back( pArray );
     }
 
-    void endArray( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void endArray( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         if( m_aObjectStack.empty() )
             parseError( "array end without begin", first );
@@ -504,7 +504,7 @@ public:
             m_aObjectStack.pop_back();
     }
 
-    void emitStream( iteratorT first, iteratorT last )
+    void emitStream(const iteratorT& first, const iteratorT& last)
     {
         if( m_aObjectStack.empty() )
             parseError( "stream without object", first );
@@ -527,7 +527,7 @@ public:
             parseError( "stream without object", first );
     }
 
-    void beginTrailer( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void beginTrailer( const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         if( m_aObjectStack.empty() )
             m_aObjectStack.push_back( new PDFPart() );
@@ -547,7 +547,7 @@ public:
             parseError( "trailer in wrong place", first );
     }
 
-    void endTrailer( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
+    void endTrailer(const iteratorT& first, SAL_UNUSED_PARAMETER iteratorT )
     {
         if( m_aObjectStack.empty() )
             parseError( "%%EOF without trailer", first );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index ff0fa9bf30c3..e00b571e9ca9 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4924,8 +4924,7 @@ void CheckReadOnlyTask::doWork()
         std::unique_lock<std::mutex> globalLock(g_chkReadOnlyGlobalMutex);
         for (auto it = g_newReadOnlyDocs.begin(); it != 
g_newReadOnlyDocs.end(); )
         {
-            auto [pMed, roEntry] = *it;
-            g_existingReadOnlyDocs[pMed] = roEntry;
+            g_existingReadOnlyDocs[it->first] = it->second;
             it = g_newReadOnlyDocs.erase(it);
         }
         if (g_existingReadOnlyDocs.empty())
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index d0ed4839dcfb..bc41f7ec755c 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -772,8 +772,7 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
                 // #i97628#
                 // encapsulate with TextHierarchyEditPrimitive2D to allow 
renderers
                 // to suppress actively edited content if needed
-                Primitive2DReference xRefA(pNew);
-                Primitive2DContainer aContent { xRefA };
+                Primitive2DContainer aContent { Primitive2DReference(pNew) };
 
                 // create and add TextHierarchyEditPrimitive2D primitive
                 return Primitive2DReference(new 
TextHierarchyEditPrimitive2D(std::move(aContent)));
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index eb1aa6ad1359..257a935002c5 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -403,7 +403,8 @@ void PaletteManager::PopupColorPicker(weld::Window* 
pParent, const OUString& aCo
     m_pColorDlg->SetColor(rInitialColor);
     m_pColorDlg->SetMode(svtools::ColorPickerMode::Modify);
     std::shared_ptr<PaletteManager> xSelf(shared_from_this());
-    m_pColorDlg->ExecuteAsync(pParent, [xSelf=std::move(xSelf), aCommandCopy] 
(sal_Int32 nResult) {
+    m_pColorDlg->ExecuteAsync(pParent, [xSelf=std::move(xSelf),
+                                        aCommandCopy=std::move(aCommandCopy)] 
(sal_Int32 nResult) {
         if (nResult == RET_OK)
         {
             Color aLastColor = xSelf->m_pColorDlg->GetColor();
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index c3128421b809..e4c7b89bc3df 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -3853,9 +3853,8 @@ uno::Any SwXAutoStylesEnumerator::nextElement(  )
     uno::Any aRet;
     if( m_pImpl->hasMoreElements() )
     {
-        std::shared_ptr<SfxItemSet> pNextSet = m_pImpl->nextElement();
         uno::Reference< style::XAutoStyle > xAutoStyle = new 
SwXAutoStyle(&m_pImpl->getDoc(),
-                                                        pNextSet, 
m_pImpl->getFamily());
+                                                        
m_pImpl->nextElement(), m_pImpl->getFamily());
         aRet <<= xAutoStyle;
     }
     return aRet;
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 2bf6c670e489..23e968ffd524 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -2649,7 +2649,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
                                                   aActionIndicesSequence,
                                                   aStringKeyMaps,
                                                   xRange,
-                                                  xController,
+                                                  std::move(xController),
                                                   std::move(aLocale),
                                                   aApplicationName,
                                                   aRangeText );
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx 
b/ucb/source/ucp/cmis/cmis_content.cxx
index 7b77607ef49a..657641ff4bfe 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -2082,8 +2082,7 @@ namespace cmis
 
             if ( typeIt != propsTypes.end( ) )
             {
-                libcmis::PropertyTypePtr propType = typeIt->second;
-                libcmis::PropertyPtr property( new libcmis::Property( 
propType, { rValue }) );
+                libcmis::PropertyPtr property( new libcmis::Property( 
typeIt->second, { rValue }) );
                 m_pObjectProps.insert(std::pair< std::string, 
libcmis::PropertyPtr >(rName, property));
             }
         }
diff --git a/vcl/source/font/FeatureCollector.cxx 
b/vcl/source/font/FeatureCollector.cxx
index fd175eade022..8d53af174a0c 100644
--- a/vcl/source/font/FeatureCollector.cxx
+++ b/vcl/source/font/FeatureCollector.cxx
@@ -75,9 +75,9 @@ bool FeatureCollector::collectGraphite()
 
             m_rFontFeatures.emplace_back(nFeatureCode, 
vcl::font::FeatureType::Graphite);
             vcl::font::Feature& rFeature = m_rFontFeatures.back();
-            rFeature.m_aDefinition
-                = vcl::font::FeatureDefinition(nFeatureCode, sLabel, 
eFeatureParameterType,
-                                               std::move(aParameters), 
int32_t(nValue));
+            rFeature.m_aDefinition = vcl::font::FeatureDefinition(
+                nFeatureCode, std::move(sLabel), eFeatureParameterType, 
std::move(aParameters),
+                int32_t(nValue));
         }
     }
     gr_featureval_destroy(pfeatureValues);
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index afe2100d8e01..d888d823494c 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -321,10 +321,9 @@ static void checkGlyphsEqual(const SalLayoutGlyphs& g1, 
const SalLayoutGlyphs& g
 }
 #endif
 
-const SalLayoutGlyphs*
-SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, 
const OUString& text,
-                                      sal_Int32 nIndex, sal_Int32 nLen, 
tools::Long nLogicWidth,
-                                      const vcl::text::TextLayoutCache* 
layoutCache)
+const SalLayoutGlyphs* SalLayoutGlyphsCache::GetLayoutGlyphs(
+    const VclPtr<const OutputDevice>& outputDevice, const OUString& text, 
sal_Int32 nIndex,
+    sal_Int32 nLen, tools::Long nLogicWidth, const vcl::text::TextLayoutCache* 
layoutCache)
 {
     if (nLen == 0)
         return nullptr;

Reply via email to