diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-30 14:52:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-30 16:12:34 +0200 |
commit | 9b902cfa55e4ca77d6ee63dc8ec8c8e45cd39bb0 (patch) | |
tree | 42580bfa053a6c41392cc9307bd164c70a8c5bfc /sot | |
parent | 2c921f24c761247639bb5ce344d6738568861564 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 5 | ||||
-rw-r--r-- | sot/source/sdstor/stgdir.cxx | 3 | ||||
-rw-r--r-- | sot/source/sdstor/stgdir.hxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 7 | ||||
-rw-r--r-- | sot/source/unoolestorage/xolesimplestorage.cxx | 5 | ||||
-rw-r--r-- | sot/source/unoolestorage/xolesimplestorage.hxx | 2 |
6 files changed, 14 insertions, 10 deletions
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; |