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 | |
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')
20 files changed, 84 insertions, 73 deletions
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 15b800430555..7fe15f70ff99 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -84,14 +84,14 @@ class ZipFile public: - ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, + ZipFile( rtl::Reference<comphelper::RefCountedMutex> aMutexHolder, css::uno::Reference < css::io::XInputStream > const &xInput, - const css::uno::Reference < css::uno::XComponentContext > &rxContext, + css::uno::Reference < css::uno::XComponentContext > xContext, bool bInitialise ); - ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, + ZipFile( rtl::Reference<comphelper::RefCountedMutex> aMutexHolder, css::uno::Reference < css::io::XInputStream > const &xInput, - const css::uno::Reference < css::uno::XComponentContext > &rxContext, + css::uno::Reference < css::uno::XComponentContext > xContext, bool bInitialise, bool bForceRecover ); diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx index 078c07359de5..678a073c6746 100644 --- a/package/inc/ZipOutputEntry.hxx +++ b/package/inc/ZipOutputEntry.hxx @@ -63,8 +63,8 @@ public: protected: ZipOutputEntryBase( - const css::uno::Reference< css::io::XOutputStream >& rxOutStream, - const css::uno::Reference< css::uno::XComponentContext >& rxContext, + css::uno::Reference< css::io::XOutputStream > xOutStream, + css::uno::Reference< css::uno::XComponentContext > xContext, ZipEntry& rEntry, ZipPackageStream* pStream, bool bEncrypt, bool checkStream); // Inherited classes call this with deflated data buffer. diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index e6cf614ad503..a4eeed261d1e 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -117,7 +117,7 @@ class ZipPackage final : public cppu::WeakImplHelper const css::uno::Reference< css::io::XInputStream >& xTempStream ); public: - ZipPackage( const css::uno::Reference < css::uno::XComponentContext > &xContext ); + ZipPackage( css::uno::Reference < css::uno::XComponentContext > xContext ); virtual ~ZipPackage() override; ZipFile& getZipFile() { return *m_pZipFile;} sal_Int32 getFormat() const { return m_nFormat; } diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx index 0240146395a8..fd86e02e4f5a 100644 --- a/package/source/manifest/ManifestImport.hxx +++ b/package/source/manifest/ManifestImport.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <unordered_map> +#include <utility> #include <vector> #include <rtl/ustrbuf.hxx> @@ -40,8 +41,8 @@ struct ManifestScopeEntry StringHashMap m_aNamespaces; bool m_bValid; - ManifestScopeEntry( const OUString& aConvertedName, StringHashMap&& aNamespaces ) - : m_aConvertedName( aConvertedName ) + ManifestScopeEntry( OUString aConvertedName, StringHashMap&& aNamespaces ) + : m_aConvertedName(std::move( aConvertedName )) , m_aNamespaces( std::move(aNamespaces) ) , m_bValid( true ) {} diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 14bfd3cab354..ef6bea3e8b06 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -25,18 +25,19 @@ #include <cppuhelper/queryinterface.hxx> #include <osl/diagnose.h> #include <sal/log.hxx> +#include <utility> #include "owriteablestream.hxx" using namespace ::com::sun::star; OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, - uno::Reference < io::XInputStream > const & xStream, + uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, sal_Int32 nStorageType ) : m_pImpl( &aImpl ) , m_xMutex( m_pImpl->m_xMutex ) -, m_xStream( xStream ) +, m_xStream(std::move( xStream )) , m_aProperties( aProps ) , m_bDisposed( false ) , m_nStorageType( nStorageType ) @@ -48,12 +49,12 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, assert(m_xStream.is()); } -OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > const & xStream, +OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, sal_Int32 nStorageType ) : m_pImpl( nullptr ) , m_xMutex( new comphelper::RefCountedMutex ) -, m_xStream( xStream ) +, m_xStream(std::move( xStream )) , m_aProperties( aProps ) , m_bDisposed( false ) , m_nStorageType( nStorageType ) diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index 4001cf1187a1..effbc4be2fb8 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -50,11 +50,11 @@ protected: public: OInputCompStream( OWriteStream_Impl& pImpl, - css::uno::Reference< css::io::XInputStream > const & xStream, + css::uno::Reference< css::io::XInputStream > xStream, const css::uno::Sequence< css::beans::PropertyValue >& aProps, sal_Int32 nStorageType ); - OInputCompStream( css::uno::Reference< css::io::XInputStream > const & xStream, + OInputCompStream( css::uno::Reference< css::io::XInputStream > xStream, const css::uno::Sequence< css::beans::PropertyValue >& aProps, sal_Int32 nStorageType ); diff --git a/package/source/xstor/ohierarchyholder.hxx b/package/source/xstor/ohierarchyholder.hxx index 6f32b3f404f2..e88632fdbb1d 100644 --- a/package/source/xstor/ohierarchyholder.hxx +++ b/package/source/xstor/ohierarchyholder.hxx @@ -31,6 +31,7 @@ #include <rtl/ref.hxx> #include <unordered_map> +#include <utility> #include <vector> class OHierarchyElement_Impl; @@ -54,12 +55,12 @@ class OHierarchyElement_Impl : public cppu::WeakImplHelper< css::embed::XTransac OWeakStorRefVector_Impl m_aOpenStreams; public: - explicit OHierarchyElement_Impl( const css::uno::Reference< css::embed::XStorage >& xStorage ) - : m_xOwnStorage( xStorage ) + explicit OHierarchyElement_Impl( css::uno::Reference< css::embed::XStorage > xStorage ) + : m_xOwnStorage(std::move( xStorage )) {} - explicit OHierarchyElement_Impl( const css::uno::WeakReference< css::embed::XStorage >& xWeakStorage ) - : m_xWeakOwnStorage( xWeakStorage ) + explicit OHierarchyElement_Impl( css::uno::WeakReference< css::embed::XStorage > xWeakStorage ) + : m_xWeakOwnStorage(std::move( xWeakStorage )) {} void Commit(); diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index c9d012a61cff..001daa439c96 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -52,6 +52,7 @@ #include <tools/diagnose_ex.h> #include <PackageConstants.hxx> +#include <utility> #include "selfterminatefilestream.hxx" #include "owriteablestream.hxx" @@ -259,17 +260,17 @@ const beans::StringPair* lcl_findPairByName(const uno::Sequence<beans::StringPai OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, const uno::Reference< packages::XDataSinkEncrSupport >& xPackageStream, const uno::Reference< lang::XSingleServiceFactory >& xPackage, - const uno::Reference< uno::XComponentContext >& rContext, + uno::Reference< uno::XComponentContext > xContext, bool bForceEncrypted, sal_Int32 nStorageType, bool bDefaultCompress, - const uno::Reference< io::XInputStream >& xRelInfoStream ) + uno::Reference< io::XInputStream > xRelInfoStream ) : m_xMutex( new comphelper::RefCountedMutex ) , m_pAntiImpl( nullptr ) , m_bHasDataToFlush( false ) , m_bFlushed( false ) , m_xPackageStream( xPackageStream ) -, m_xContext( rContext ) +, m_xContext(std::move( xContext )) , m_pParent( pParent ) , m_bForceEncrypted( bForceEncrypted ) , m_bUseCommonEncryption( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE ) @@ -278,7 +279,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, , m_xPackage( xPackage ) , m_bHasInsertedStreamOptimization( false ) , m_nStorageType( nStorageType ) -, m_xOrigRelInfoStream( xRelInfoStream ) +, m_xOrigRelInfoStream(std::move( xRelInfoStream )) , m_bOrigRelInfoBroken( false ) , m_nRelInfoStatus( RELINFO_NO_INIT ) , m_nRelId( 1 ) diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index 6c2b657e3160..1da7ff0a333f 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -137,11 +137,11 @@ public: OStorage_Impl* pParent, const css::uno::Reference< css::packages::XDataSinkEncrSupport >& xPackageStream, const css::uno::Reference< css::lang::XSingleServiceFactory >& xPackage, - const css::uno::Reference< css::uno::XComponentContext >& xContext, + css::uno::Reference< css::uno::XComponentContext > xContext, bool bForceEncrypted, sal_Int32 nStorageType, bool bDefaultCompress, - const css::uno::Reference< css::io::XInputStream >& xRelInfoStream = + css::uno::Reference< css::io::XInputStream > xRelInfoStream = css::uno::Reference< css::io::XInputStream >() ); ~OWriteStream_Impl(); diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx index ff9828a72b91..f4ccd452b8f9 100644 --- a/package/source/xstor/switchpersistencestream.cxx +++ b/package/source/xstor/switchpersistencestream.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/io/NotConnectedException.hpp> #include <com/sun/star/io/TempFile.hpp> #include <comphelper/storagehelper.hxx> +#include <utility> #include "switchpersistencestream.hxx" using namespace ::com::sun::star; @@ -43,17 +44,17 @@ struct SPStreamData_Impl SPStreamData_Impl( bool bInStreamBased, - const uno::Reference< io::XTruncate >& xOrigTruncate, - const uno::Reference< io::XSeekable >& xOrigSeekable, - const uno::Reference< io::XInputStream >& xOrigInStream, - const uno::Reference< io::XOutputStream >& xOrigOutStream, + uno::Reference< io::XTruncate > xOrigTruncate, + uno::Reference< io::XSeekable > xOrigSeekable, + uno::Reference< io::XInputStream > xOrigInStream, + uno::Reference< io::XOutputStream > xOrigOutStream, bool bInOpen, bool bOutOpen ) : m_bInStreamBased( bInStreamBased ) - , m_xOrigTruncate( xOrigTruncate ) - , m_xOrigSeekable( xOrigSeekable ) - , m_xOrigInStream( xOrigInStream ) - , m_xOrigOutStream( xOrigOutStream ) + , m_xOrigTruncate(std::move( xOrigTruncate )) + , m_xOrigSeekable(std::move( xOrigSeekable )) + , m_xOrigInStream(std::move( xOrigInStream )) + , m_xOrigOutStream(std::move( xOrigOutStream )) , m_bInOpen( bInOpen ) , m_bOutOpen( bOutOpen ) { @@ -61,17 +62,17 @@ struct SPStreamData_Impl }; SwitchablePersistenceStream::SwitchablePersistenceStream( - const uno::Reference< uno::XComponentContext >& xContext, + uno::Reference< uno::XComponentContext > xContext, const uno::Reference< io::XStream >& xStream ) -: m_xContext( xContext ) +: m_xContext(std::move( xContext )) { SwitchPersistenceTo( xStream ); } SwitchablePersistenceStream::SwitchablePersistenceStream( - const uno::Reference< uno::XComponentContext >& xContext, + uno::Reference< uno::XComponentContext > xContext, const uno::Reference< io::XInputStream >& xInputStream ) -: m_xContext( xContext ) +: m_xContext(std::move( xContext )) { SwitchPersistenceTo( xInputStream ); } diff --git a/package/source/xstor/switchpersistencestream.hxx b/package/source/xstor/switchpersistencestream.hxx index f1e9ddceea96..ad0293be8110 100644 --- a/package/source/xstor/switchpersistencestream.hxx +++ b/package/source/xstor/switchpersistencestream.hxx @@ -58,11 +58,11 @@ class SwitchablePersistenceStream public: SwitchablePersistenceStream( - const css::uno::Reference< css::uno::XComponentContext >& xContext, + css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::io::XStream >& xStream ); SwitchablePersistenceStream( - const css::uno::Reference< css::uno::XComponentContext >& xContext, + css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::io::XInputStream >& xInStream ); virtual ~SwitchablePersistenceStream() override; diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index bdcd699a7eb7..bed733b10532 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -55,6 +55,7 @@ #include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/ofopxmlhelper.hxx> +#include <utility> #include <tools/diagnose_ex.h> #include "xstorage.hxx" @@ -127,8 +128,8 @@ static uno::Reference< io::XInputStream > GetSeekableTempCopy( const uno::Refere return xTempIn; } -SotElement_Impl::SotElement_Impl(const OUString& rName, bool bStor, bool bNew) - : m_aOriginalName(rName) +SotElement_Impl::SotElement_Impl(OUString aName, bool bStor, bool bNew) + : m_aOriginalName(std::move(aName)) , m_bIsRemoved(false) , m_bIsInserted(bNew) , m_bIsStorage(bStor) @@ -220,7 +221,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > const & xStream, OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, sal_Int32 nMode, uno::Reference< container::XNameContainer > const & xPackageFolder, - uno::Reference< lang::XSingleServiceFactory > const & xPackage, + uno::Reference< lang::XSingleServiceFactory > xPackage, uno::Reference< uno::XComponentContext > const & xContext, sal_Int32 nStorageType ) : m_xMutex( new comphelper::RefCountedMutex ) @@ -233,7 +234,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, , m_bListCreated( false ) , m_nModifiedListenerCount( 0 ) , m_xPackageFolder( xPackageFolder ) -, m_xPackage( xPackage ) +, m_xPackage(std::move( xPackage )) , m_xContext( xContext ) , m_bHasCommonEncryptionData( false ) , m_pParent( pParent ) // can be empty in case of temporary readonly substorages and relation storage diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index 35a80e717704..1fefb8f4671a 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -88,7 +88,7 @@ struct SotElement_Impl std::unique_ptr<OWriteStream_Impl, o3tl::default_delete<OWriteStream_Impl>> m_xStream; public: - SotElement_Impl(const OUString& rName, bool bStor, bool bNew); + SotElement_Impl(OUString aName, bool bStor, bool bNew); }; // Main storage implementation @@ -182,7 +182,7 @@ struct OStorage_Impl OStorage_Impl( OStorage_Impl* pParent, sal_Int32 nMode, css::uno::Reference< css::container::XNameContainer > const & xPackageFolder, - css::uno::Reference< css::lang::XSingleServiceFactory > const & xPackage, + css::uno::Reference< css::lang::XSingleServiceFactory > xPackage, css::uno::Reference< css::uno::XComponentContext > const & xContext, sal_Int32 nStorageType ); diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index 56f864a2df05..649760a5125d 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.cxx @@ -30,6 +30,7 @@ #include <osl/diagnose.h> #include <osl/mutex.hxx> +#include <utility> #include <tools/diagnose_ex.h> using namespace ::com::sun::star; @@ -40,7 +41,7 @@ using com::sun::star::packages::zip::ZipIOException; XUnbufferedStream::XUnbufferedStream( const uno::Reference< uno::XComponentContext >& xContext, - const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, + rtl::Reference< comphelper::RefCountedMutex > aMutexHolder, ZipEntry const & rEntry, Reference < XInputStream > const & xNewZipStream, const ::rtl::Reference< EncryptionData >& rData, @@ -48,7 +49,7 @@ XUnbufferedStream::XUnbufferedStream( bool bIsEncrypted, const OUString& aMediaType, bool bRecoveryMode ) -: maMutexHolder( aMutexHolder ) +: maMutexHolder(std::move( aMutexHolder )) , mxZipStream ( xNewZipStream ) , mxZipSeek ( xNewZipStream, UNO_QUERY ) , maEntry ( rEntry ) @@ -111,10 +112,10 @@ XUnbufferedStream::XUnbufferedStream( // allows to read package raw stream XUnbufferedStream::XUnbufferedStream( - const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, + rtl::Reference< comphelper::RefCountedMutex > aMutexHolder, const Reference < XInputStream >& xRawStream, const ::rtl::Reference< EncryptionData >& rData ) -: maMutexHolder( aMutexHolder ) +: maMutexHolder(std::move( aMutexHolder )) , mxZipStream ( xRawStream ) , mxZipSeek ( xRawStream, UNO_QUERY ) , mnBlockSize( 1 ) diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx index 277f356ee18c..af57706386c3 100644 --- a/package/source/zipapi/XUnbufferedStream.hxx +++ b/package/source/zipapi/XUnbufferedStream.hxx @@ -62,7 +62,7 @@ class XUnbufferedStream final : public cppu::WeakImplHelper public: XUnbufferedStream( const css::uno::Reference< css::uno::XComponentContext >& xContext, - const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, + rtl::Reference<comphelper::RefCountedMutex> aMutexHolder, ZipEntry const & rEntry, css::uno::Reference < css::io::XInputStream > const & xNewZipStream, const ::rtl::Reference< EncryptionData >& rData, @@ -73,7 +73,7 @@ public: // allows to read package raw stream XUnbufferedStream( - const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, + rtl::Reference<comphelper::RefCountedMutex> aMutexHolder, const css::uno::Reference < css::io::XInputStream >& xRawStream, const ::rtl::Reference< EncryptionData >& rData ); diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 79dc5bb68a8e..63ba823e240e 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -42,6 +42,7 @@ #include <algorithm> #include <iterator> +#include <utility> #include <vector> #include "blowfishcontext.hxx" @@ -75,15 +76,15 @@ using ZipUtils::Inflater; /** This class is used to read entries from a zip file */ -ZipFile::ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, +ZipFile::ZipFile( rtl::Reference<comphelper::RefCountedMutex> aMutexHolder, uno::Reference < XInputStream > const &xInput, - const uno::Reference < XComponentContext > & rxContext, + uno::Reference < XComponentContext > xContext, bool bInitialise ) -: m_aMutexHolder( aMutexHolder ) +: m_aMutexHolder(std::move( aMutexHolder )) , aGrabber( xInput ) , aInflater( true ) , xStream(xInput) -, m_xContext ( rxContext ) +, m_xContext (std::move( xContext )) , bRecoveryMode( false ) { if (bInitialise && readCEN() == -1 ) @@ -93,15 +94,15 @@ ZipFile::ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolde } } -ZipFile::ZipFile( const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, +ZipFile::ZipFile( rtl::Reference< comphelper::RefCountedMutex > aMutexHolder, uno::Reference < XInputStream > const &xInput, - const uno::Reference < XComponentContext > & rxContext, + uno::Reference < XComponentContext > xContext, bool bInitialise, bool bForceRecovery) -: m_aMutexHolder( aMutexHolder ) +: m_aMutexHolder(std::move( aMutexHolder )) , aGrabber( xInput ) , aInflater( true ) , xStream(xInput) -, m_xContext ( rxContext ) +, m_xContext (std::move( xContext )) , bRecoveryMode( bForceRecovery ) { if (bInitialise) diff --git a/package/source/zipapi/ZipOutputEntry.cxx b/package/source/zipapi/ZipOutputEntry.cxx index 897ea6212430..2eb5f9db4391 100644 --- a/package/source/zipapi/ZipOutputEntry.cxx +++ b/package/source/zipapi/ZipOutputEntry.cxx @@ -31,6 +31,7 @@ #include <ZipPackageStream.hxx> #include <algorithm> +#include <utility> using namespace com::sun::star; using namespace com::sun::star::io; @@ -40,14 +41,14 @@ using namespace com::sun::star::packages::zip::ZipConstants; /** This class is used to deflate Zip entries */ ZipOutputEntryBase::ZipOutputEntryBase( - const css::uno::Reference< css::io::XOutputStream >& rxOutput, - const uno::Reference< uno::XComponentContext >& rxContext, + css::uno::Reference< css::io::XOutputStream > xOutput, + uno::Reference< uno::XComponentContext > xContext, ZipEntry& rEntry, ZipPackageStream* pStream, bool bEncrypt, bool checkStream) -: m_xContext(rxContext) -, m_xOutStream(rxOutput) +: m_xContext(std::move(xContext)) +, m_xOutStream(std::move(xOutput)) , m_pCurrentEntry(&rEntry) , m_nDigested(0) , m_pCurrentStream(pStream) @@ -279,10 +280,10 @@ class ZipOutputEntryInThread::Task : public comphelper::ThreadTask public: Task( const std::shared_ptr<comphelper::ThreadTaskTag>& pTag, ZipOutputEntryInThread *pEntry, - const uno::Reference< io::XInputStream >& xInStream ) + uno::Reference< io::XInputStream > xInStream ) : comphelper::ThreadTask(pTag) , mpEntry(pEntry) - , mxInStream(xInStream) + , mxInStream(std::move(xInStream)) {} private: 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 |