include/sot/stg.hxx                            |    2 +-
 include/sot/storinfo.hxx                       |    5 +++--
 sot/source/sdstor/stg.cxx                      |    5 +++--
 sot/source/sdstor/stgdir.cxx                   |    3 ++-
 sot/source/sdstor/stgdir.hxx                   |    2 +-
 sot/source/sdstor/ucbstorage.cxx               |    7 ++++---
 sot/source/unoolestorage/xolesimplestorage.cxx |    5 +++--
 sot/source/unoolestorage/xolesimplestorage.hxx |    2 +-
 sw/source/core/crsr/findattr.cxx               |    4 ++--
 9 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 9b902cfa55e4ca77d6ee63dc8ec8c8e45cd39bb0
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon May 30 14:52:58 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon May 30 16:12:34 2022 +0200

    clang-tidy modernize-pass-by-value in sot
    
    Change-Id: I1ff31ae1291a82630ae32185077e369bbdfd3a0b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135127
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx
index 1cd16ac32e89..72003f08fd49 100644
--- a/include/sot/stg.hxx
+++ b/include/sot/stg.hxx
@@ -154,7 +154,7 @@ class UNLESS_MERGELIBS(SOT_DLLPUBLIC) Storage final : 
public BaseStorage, public
                                 Storage( StgIo*, StgDirEntry*, StreamMode );
                                 virtual ~Storage() override;
 public:
-                                Storage( const OUString &, StreamMode, bool 
bDirect );
+                                Storage( OUString, StreamMode, bool bDirect );
                                 Storage( SvStream& rStrm, bool bDirect );
                                 Storage( UCBStorageStream& rStrm, bool bDirect 
);
 
diff --git a/include/sot/storinfo.hxx b/include/sot/storinfo.hxx
index 8b9866549c07..c1283cffe1a8 100644
--- a/include/sot/storinfo.hxx
+++ b/include/sot/storinfo.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SOT_STORINFO_HXX
 
 #include <rtl/ustring.hxx>
+#include <utility>
 #include <vector>
 #include <sot/sotdllapi.h>
 #include <sot/formats.hxx>
@@ -38,8 +39,8 @@ class SvStorageInfo
 
 public:
     SvStorageInfo(const StgDirEntry&);
-    SvStorageInfo(const OUString& rName, sal_uInt64 nSz, bool bIsStorage)
-        : aName(rName)
+    SvStorageInfo(OUString _aName, sal_uInt64 nSz, bool bIsStorage)
+        : aName(std::move(_aName))
         , nSize(nSz)
         , bStream(!bIsStorage)
         , bStorage(bIsStorage)
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index a874b199a856..08af343092fa 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -25,6 +25,7 @@
 #include <tools/debug.hxx>
 
 #include <sot/stg.hxx>
+#include <utility>
 #include "stgelem.hxx"
 #include "stgdir.hxx"
 #include "stgio.hxx"
@@ -330,9 +331,9 @@ bool Storage::IsStorageFile( SvStream* pStream )
 // a storage file, initialize it.
 
 
-Storage::Storage( const OUString& rFile, StreamMode m, bool bDirect )
+Storage::Storage( OUString aFile, StreamMode m, bool bDirect )
     : OLEStorageBase( new StgIo, nullptr, m_nMode )
-    , aName( rFile ), bIsRoot( false )
+    , aName(std::move( aFile )), bIsRoot( false )
 {
     bool bTemp = false;
     if( aName.isEmpty() )
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 892c4e705e1f..d4d629aedd11 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -28,6 +28,7 @@
 #include <sal/log.hxx>
 
 #include <memory>
+#include <utility>
 
 //////////////////////////// class StgDirEntry
 
@@ -52,7 +53,7 @@ StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 
nBufferLen, sal_uInt64
     InitMembers();
 }
 
-StgDirEntry::StgDirEntry( const StgEntry& r ) :  m_aEntry( r )
+StgDirEntry::StgDirEntry( StgEntry r ) :  m_aEntry(std::move( r ))
 {
     InitMembers();
 }
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index 3605c27ac03d..5044dc48f313 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -59,7 +59,7 @@ public:
     bool         m_bInvalid;                  // true: invalid entry
     StgDirEntry(const void* pBuffer, sal_uInt32 nBufferLen,
                 sal_uInt64 nUnderlyingStreamSize, bool * pbOk);
-    explicit StgDirEntry( const StgEntry& );
+    explicit StgDirEntry( StgEntry );
     virtual ~StgDirEntry() override;
 
     void Invalidate( bool );                // invalidate all open entries
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index f94556edbafc..f478173d5dc5 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -64,6 +64,7 @@
 #include <comphelper/classids.hxx>
 
 #include <mutex>
+#include <utility>
 #include <vector>
 
 namespace com::sun::star::ucb { class XCommandEnvironment; }
@@ -93,7 +94,7 @@ protected:
     std::unique_ptr<SvStream> m_pSvStream;
 
 public:
-    explicit FileStreamWrapper_Impl(const OUString& rName);
+    explicit FileStreamWrapper_Impl(OUString aName);
     virtual ~FileStreamWrapper_Impl() override;
 
     virtual void SAL_CALL seek( sal_Int64 _nLocation ) override;
@@ -112,8 +113,8 @@ protected:
 
 }
 
-FileStreamWrapper_Impl::FileStreamWrapper_Impl( const OUString& rName )
-    : m_aURL( rName )
+FileStreamWrapper_Impl::FileStreamWrapper_Impl( OUString aName )
+    : m_aURL(std::move( aName ))
 {
     // if no URL is provided the stream is empty
 }
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx 
b/sot/source/unoolestorage/xolesimplestorage.cxx
index 58bfe785fb25..49a785ed5ff9 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -35,6 +35,7 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <sot/stg.hxx>
 #include <sot/storinfo.hxx>
+#include <utility>
 
 using namespace ::com::sun::star;
 
@@ -42,11 +43,11 @@ const sal_Int32 nBytesCount = 32000;
 
 
 OLESimpleStorage::OLESimpleStorage(
-        css::uno::Reference<css::uno::XComponentContext> const & xContext,
+        css::uno::Reference<css::uno::XComponentContext> xContext,
         css::uno::Sequence<css::uno::Any> const &aArguments)
 : m_bDisposed( false )
 , m_pListenersContainer( nullptr )
-, m_xContext( xContext )
+, m_xContext(std::move( xContext ))
 , m_bNoTemporaryCopy( false )
 {
     sal_Int32 nArgNum = aArguments.getLength();
diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx 
b/sot/source/unoolestorage/xolesimplestorage.hxx
index 765cd87caf12..eedfc81c29ac 100644
--- a/sot/source/unoolestorage/xolesimplestorage.hxx
+++ b/sot/source/unoolestorage/xolesimplestorage.hxx
@@ -66,7 +66,7 @@ class OLESimpleStorage : public 
cppu::WeakImplHelper<css::embed::XOLESimpleStora
 
 public:
 
-    OLESimpleStorage(css::uno::Reference<css::uno::XComponentContext> const & 
xContext,
+    OLESimpleStorage(css::uno::Reference<css::uno::XComponentContext> xContext,
             css::uno::Sequence<css::uno::Any> const &arguments);
 
     virtual ~OLESimpleStorage() override;
commit 2c921f24c761247639bb5ce344d6738568861564
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon May 30 14:10:20 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon May 30 16:12:20 2022 +0200

    use more SfxWhichIter::GetItemState
    
    Change-Id: Iae284fcad199684920aef0bd91ff39c407b48e0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135125
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index ac53ea567774..51728f49b071 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -467,7 +467,7 @@ bool SwAttrCheckArr::SetAttrFwd( const SwTextAttr& rAttr )
             assert(pSet && "otherwise no oIter");
             nWhch = oIter->NextWhich();
             while( nWhch &&
-                SfxItemState::SET != pSet->GetItemState( nWhch, true, 
&pTmpItem ) )
+                SfxItemState::SET != oIter->GetItemState( true, &pTmpItem ) )
                 nWhch = oIter->NextWhich();
             if( !nWhch )
                 break;
@@ -625,7 +625,7 @@ bool SwAttrCheckArr::SetAttrBwd( const SwTextAttr& rAttr )
             assert(pSet && "otherwise no oIter");
             nWhch = oIter->NextWhich();
             while( nWhch &&
-                SfxItemState::SET != pSet->GetItemState( nWhch, true, 
&pTmpItem ) )
+                SfxItemState::SET != oIter->GetItemState( true, &pTmpItem ) )
                 nWhch = oIter->NextWhich();
             if( !nWhch )
                 break;

Reply via email to