diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-23 15:06:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-23 18:24:16 +0200 |
commit | 74ff1a4355090c227f4bdcdddb20482a4abd6064 (patch) | |
tree | 06ace5d2a3d8e5eb2a8d08c9835350f69d870e92 /package/source/zippackage | |
parent | c7c2f6b37a834a3135e3683f1fc27f3ec938640c (diff) |
clang-tidy modernize-pass-by-value in package
Change-Id: Id12d7b38d278c9fb18b30c6d921713a53168b048
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136337
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package/source/zippackage')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 5 | ||||
-rw-r--r-- | package/source/zippackage/wrapstreamforshare.cxx | 9 | ||||
-rw-r--r-- | package/source/zippackage/wrapstreamforshare.hxx | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 9270bb70502e..0d9d66970ffd 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -73,6 +73,7 @@ #include <cppuhelper/supportsservice.hxx> #include <comphelper/sequence.hxx> #include <comphelper/servicehelper.hxx> +#include <utility> using namespace osl; using namespace cppu; @@ -131,7 +132,7 @@ class DummyInputStream : public ::cppu::WeakImplHelper< XInputStream > } -ZipPackage::ZipPackage ( const uno::Reference < XComponentContext > &xContext ) +ZipPackage::ZipPackage ( uno::Reference < XComponentContext > xContext ) : m_aMutexHolder( new comphelper::RefCountedMutex ) , m_nStartKeyGenerationID( xml::crypto::DigestID::SHA1 ) , m_nChecksumDigestID( xml::crypto::DigestID::SHA1_1K ) @@ -144,7 +145,7 @@ ZipPackage::ZipPackage ( const uno::Reference < XComponentContext > &xContext ) , m_nFormat( embed::StorageFormats::PACKAGE ) // package is the default format , m_bAllowRemoveOnInsert( true ) , m_eMode ( e_IMode_None ) -, m_xContext( xContext ) +, m_xContext(std::move( xContext )) { m_xRootFolder = new ZipPackageFolder( m_xContext, m_nFormat, m_bAllowRemoveOnInsert ); } diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index e5a47566551e..250ccb4ba5ce 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <com/sun/star/io/IOException.hpp> +#include <utility> #include <osl/diagnose.h> #include "wrapstreamforshare.hxx" @@ -33,10 +34,10 @@ using namespace ::com::sun::star; #define THROW_WHERE "" #endif -WrapStreamForShare::WrapStreamForShare( const uno::Reference< io::XInputStream >& xInStream, - const rtl::Reference< comphelper::RefCountedMutex >& rMutexRef ) -: m_xMutex( rMutexRef ) -, m_xInStream( xInStream ) +WrapStreamForShare::WrapStreamForShare( uno::Reference< io::XInputStream > xInStream, + rtl::Reference< comphelper::RefCountedMutex > xMutexRef ) +: m_xMutex(std::move( xMutexRef )) +, m_xInStream(std::move( xInStream )) , m_nCurPos( 0 ) { if ( !m_xMutex.is() || !m_xInStream.is() ) diff --git a/package/source/zippackage/wrapstreamforshare.hxx b/package/source/zippackage/wrapstreamforshare.hxx index 238483b769f7..ac8de258842f 100644 --- a/package/source/zippackage/wrapstreamforshare.hxx +++ b/package/source/zippackage/wrapstreamforshare.hxx @@ -36,8 +36,8 @@ class WrapStreamForShare final : public cppu::WeakImplHelper < css::io::XInputSt sal_Int64 m_nCurPos; public: - WrapStreamForShare( const css::uno::Reference< css::io::XInputStream >& xInStream, - const rtl::Reference< comphelper::RefCountedMutex >& rMutexRef ); + WrapStreamForShare( css::uno::Reference< css::io::XInputStream > xInStream, + rtl::Reference< comphelper::RefCountedMutex > xMutexRef ); virtual ~WrapStreamForShare() override; // XInputStream |