diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-17 10:50:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-13 19:11:49 +0200 |
commit | 1743d74e87745a26043642a06dc8a57b1af29740 (patch) | |
tree | 86354c464ed2e51bf940b58333844c0ad0670d01 | |
parent | a0b9a7e7f0d14d0f121e54cb8979074bc5dfbe38 (diff) |
clang-tidy modernize-pass-by-value in various
Change-Id: Ie091b22bd77d4e1fbff46545bc86c12f1dbafcfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138171
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | cpputools/source/unoexe/unoexe.cxx | 15 | ||||
-rw-r--r-- | emfio/source/emfuno/xemfparser.cxx | 7 | ||||
-rw-r--r-- | eventattacher/source/eventattacher.cxx | 13 | ||||
-rw-r--r-- | hwpfilter/source/attributes.cxx | 5 | ||||
-rw-r--r-- | include/opencl/openclconfig.hxx | 21 | ||||
-rw-r--r-- | include/unotest/macros_test.hxx | 5 | ||||
-rw-r--r-- | include/xmlscript/xml_helper.hxx | 5 | ||||
-rw-r--r-- | lingucomponent/source/thesaurus/libnth/nthesdta.cxx | 8 | ||||
-rw-r--r-- | lingucomponent/source/thesaurus/libnth/nthesdta.hxx | 2 | ||||
-rw-r--r-- | opencl/inc/opencl_device_selection.h | 5 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_adapter.cxx | 5 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_impl.hxx | 2 | ||||
-rw-r--r-- | registry/source/keyimpl.cxx | 5 | ||||
-rw-r--r-- | registry/source/keyimpl.hxx | 2 | ||||
-rw-r--r-- | smoketest/smoketest.cxx | 10 | ||||
-rw-r--r-- | store/source/storbase.hxx | 12 | ||||
-rw-r--r-- | testtools/source/bridgetest/multi.cxx | 3 |
17 files changed, 67 insertions, 58 deletions
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index f8e5aa12d492..d4c51e2f40c3 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/connection/XConnection.hpp> #include <com/sun/star/bridge/XBridgeFactory.hpp> #include <com/sun/star/bridge/XBridge.hpp> +#include <utility> using namespace osl; using namespace cppu; @@ -246,16 +247,16 @@ class OInstanceProvider public: OInstanceProvider( const Reference< XComponentContext > & xContext, - const OUString & rImplName, const OUString & rLocation, - const OUString & rServiceName, const Sequence< Any > & rInitParams, - bool bSingleInstance, const OUString & rInstanceName ) + OUString aImplName, OUString aLocation, + OUString aServiceName, const Sequence< Any > & rInitParams, + bool bSingleInstance, OUString aInstanceName ) : _xContext( xContext ) , _bSingleInstance( bSingleInstance ) - , _aImplName( rImplName ) - , _aLocation( rLocation ) - , _aServiceName( rServiceName ) + , _aImplName(std::move( aImplName )) + , _aLocation(std::move( aLocation )) + , _aServiceName(std::move( aServiceName )) , _aInitParams( rInitParams ) - , _aInstanceName( rInstanceName ) + , _aInstanceName(std::move( aInstanceName )) {} // XInstanceProvider diff --git a/emfio/source/emfuno/xemfparser.cxx b/emfio/source/emfuno/xemfparser.cxx index d5342edf747f..55b96e31c222 100644 --- a/emfio/source/emfuno/xemfparser.cxx +++ b/emfio/source/emfuno/xemfparser.cxx @@ -24,6 +24,7 @@ #include <cppuhelper/implbase2.hxx> #include <cppuhelper/supportsservice.hxx> +#include <utility> #include <vcl/outdev.hxx> #include <vcl/svapp.hxx> #include <vcl/wmfexternal.hxx> @@ -50,7 +51,7 @@ namespace emfio::emfreader public: explicit XEmfParser( - uno::Reference< uno::XComponentContext > const & context); + uno::Reference< uno::XComponentContext > context); XEmfParser(const XEmfParser&) = delete; XEmfParser& operator=(const XEmfParser&) = delete; @@ -70,8 +71,8 @@ namespace emfio::emfreader } XEmfParser::XEmfParser( - uno::Reference< uno::XComponentContext > const & context): - context_(context) + uno::Reference< uno::XComponentContext > context): + context_(std::move(context)) { } diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx index 33c41a0f9d03..f344e0cccb0d 100644 --- a/eventattacher/source/eventattacher.cxx +++ b/eventattacher/source/eventattacher.cxx @@ -40,6 +40,7 @@ #include <cppuhelper/supportsservice.hxx> #include <mutex> +#include <utility> namespace com::sun::star::lang { class XMultiServiceFactory; } @@ -65,7 +66,7 @@ class InvocationToAllListenerMapper : public WeakImplHelper< XInvocation > { public: InvocationToAllListenerMapper( const Reference< XIdlClass >& ListenerType, - const Reference< XAllListener >& AllListener, const Any& Helper ); + const Reference< XAllListener >& AllListener, Any Helper ); // XInvocation virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection() override; @@ -107,10 +108,10 @@ static Reference< XInterface > createAllListenerAdapter // InvocationToAllListenerMapper InvocationToAllListenerMapper::InvocationToAllListenerMapper - ( const Reference< XIdlClass >& ListenerType, const Reference< XAllListener >& AllListener, const Any& Helper ) + ( const Reference< XIdlClass >& ListenerType, const Reference< XAllListener >& AllListener, Any Helper ) : m_xAllListener( AllListener ) , m_xListenerType( ListenerType ) - , m_Helper( Helper ) + , m_Helper(std::move( Helper )) { } @@ -394,7 +395,7 @@ namespace { class FilterAllListenerImpl : public WeakImplHelper< XAllListener > { public: - FilterAllListenerImpl( EventAttacherImpl * pEA_, const OUString& EventMethod_, + FilterAllListenerImpl( EventAttacherImpl * pEA_, OUString EventMethod_, const Reference< XAllListener >& AllListener_ ); // XAllListener @@ -417,10 +418,10 @@ private: } -FilterAllListenerImpl::FilterAllListenerImpl( EventAttacherImpl * pEA_, const OUString& EventMethod_, +FilterAllListenerImpl::FilterAllListenerImpl( EventAttacherImpl * pEA_, OUString EventMethod_, const Reference< XAllListener >& AllListener_ ) : m_pEA( pEA_ ) - , m_EventMethod( EventMethod_ ) + , m_EventMethod(std::move( EventMethod_ )) , m_AllListener( AllListener_ ) { } diff --git a/hwpfilter/source/attributes.cxx b/hwpfilter/source/attributes.cxx index 602165ba0c32..3b24d45b0351 100644 --- a/hwpfilter/source/attributes.cxx +++ b/hwpfilter/source/attributes.cxx @@ -19,6 +19,7 @@ #include <assert.h> +#include <utility> #include <vector> #include "attributes.hxx" @@ -26,8 +27,8 @@ namespace { struct TagAttribute { - TagAttribute( const OUString &rName, const OUString &rType , const OUString &rValue ) - : sName(rName), sType(rType), sValue(rValue) + TagAttribute( OUString aName, OUString aType, OUString aValue ) + : sName(std::move(aName)), sType(std::move(aType)), sValue(std::move(aValue)) { } diff --git a/include/opencl/openclconfig.hxx b/include/opencl/openclconfig.hxx index 7247b4fa6e62..2e099bafe69e 100644 --- a/include/opencl/openclconfig.hxx +++ b/include/opencl/openclconfig.hxx @@ -15,6 +15,7 @@ #include <opencl/opencldllapi.h> #include <rtl/ustring.hxx> +#include <utility> struct OpenCLDeviceInfo; struct OpenCLPlatformInfo; @@ -33,16 +34,16 @@ struct OPENCL_DLLPUBLIC OpenCLConfig { } - ImplMatcher(const OUString& rOS, - const OUString& rOSVersion, - const OUString& rPlatformVendor, - const OUString& rDevice, - const OUString& rDriverVersion) - : maOS(rOS), - maOSVersion(rOSVersion), - maPlatformVendor(rPlatformVendor), - maDevice(rDevice), - maDriverVersion(rDriverVersion) + ImplMatcher(OUString aOS, + OUString aOSVersion, + OUString aPlatformVendor, + OUString aDevice, + OUString aDriverVersion) + : maOS(std::move(aOS)), + maOSVersion(std::move(aOSVersion)), + maPlatformVendor(std::move(aPlatformVendor)), + maDevice(std::move(aDevice)), + maDriverVersion(std::move(aDriverVersion)) { } diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx index 85a99789ccdb..8773a6c99568 100644 --- a/include/unotest/macros_test.hxx +++ b/include/unotest/macros_test.hxx @@ -20,6 +20,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/frame/XDesktop2.hpp> +#include <utility> struct TestMacroInfo { @@ -59,8 +60,8 @@ public: std::function<void()> m_Func; public: - Resetter(std::function<void()> const& rFunc) - : m_Func(rFunc) + Resetter(std::function<void()> aFunc) + : m_Func(std::move(aFunc)) { } ~Resetter() diff --git a/include/xmlscript/xml_helper.hxx b/include/xmlscript/xml_helper.hxx index 4baed88da3b2..92b0ddb7684b 100644 --- a/include/xmlscript/xml_helper.hxx +++ b/include/xmlscript/xml_helper.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include <utility> #include <vector> #include <cppuhelper/implbase.hxx> #include <com/sun/star/xml/sax/XAttributeList.hpp> @@ -42,8 +43,8 @@ class XMLElement : public cppu::WeakImplHelper< css::xml::sax::XAttributeList > { public: - XMLElement( OUString const & name ) - : _name( name ) + XMLElement( OUString name ) + : _name(std::move( name )) {} /** Adds a sub element of element. diff --git a/lingucomponent/source/thesaurus/libnth/nthesdta.cxx b/lingucomponent/source/thesaurus/libnth/nthesdta.cxx index aa7d2afa7f8d..6d076d84841a 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesdta.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesdta.cxx @@ -21,6 +21,7 @@ #include "nthesdta.hxx" #include <linguistic/misc.hxx> +#include <utility> using namespace osl; using namespace com::sun::star; @@ -32,12 +33,9 @@ using namespace com::sun::star::linguistic2; namespace linguistic { -Meaning::Meaning( - const OUString &rTerm) : - +Meaning::Meaning(OUString _aTerm) : aSyn ( Sequence< OUString >(1) ), - aTerm (rTerm) - + aTerm (std::move(_aTerm)) { #if 0 // this is for future use by a german thesaurus when one exists diff --git a/lingucomponent/source/thesaurus/libnth/nthesdta.hxx b/lingucomponent/source/thesaurus/libnth/nthesdta.hxx index 8e6cb7561a94..fb2c6438d751 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesdta.hxx +++ b/lingucomponent/source/thesaurus/libnth/nthesdta.hxx @@ -41,7 +41,7 @@ class Meaning : Meaning & operator = (const Meaning &) = delete; public: - explicit Meaning(const OUString &rTerm); + explicit Meaning(OUString aTerm); virtual ~Meaning() override; // XMeaning diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h index af0ecd37be5c..ed4914bbcf39 100644 --- a/opencl/inc/opencl_device_selection.h +++ b/opencl/inc/opencl_device_selection.h @@ -26,6 +26,7 @@ #include <opencl/OpenCLZone.hxx> +#include <utility> #include <vector> enum ds_status @@ -88,8 +89,8 @@ struct ds_profile std::vector<ds_device> devices; OString version; - ds_profile(OString const & inVersion) - : version(inVersion) + ds_profile(OString inVersion) + : version(std::move(inVersion)) {} }; diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx index 27c7eeae2ec7..595e09a1f85d 100644 --- a/pyuno/source/module/pyuno_adapter.cxx +++ b/pyuno/source/module/pyuno_adapter.cxx @@ -29,6 +29,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/exc_hlp.hxx> +#include <utility> using com::sun::star::beans::XIntrospectionAccess; @@ -51,8 +52,8 @@ using com::sun::star::reflection::ParamInfo; namespace pyuno { -Adapter::Adapter( const PyRef & ref, const Sequence< Type > &types ) - : mWrappedObject( ref ), +Adapter::Adapter( PyRef ref, const Sequence< Type > &types ) + : mWrappedObject(std::move( ref )), mInterpreter( (PyThreadState_Get()->interp) ), mTypes( types ) {} diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx index 422f3fdb3dff..90e94af07401 100644 --- a/pyuno/source/module/pyuno_impl.hxx +++ b/pyuno/source/module/pyuno_impl.hxx @@ -259,7 +259,7 @@ private: public: public: - Adapter( const PyRef &obj, + Adapter( PyRef obj, const css::uno::Sequence< css::uno::Type > & types ); static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 37efeda82ff1..34e51483e7cc 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -29,14 +29,15 @@ #include <osl/diagnose.h> #include <sal/log.hxx> #include <memory> +#include <utility> using namespace store; namespace { char const VALUE_PREFIX[] = "$VL_"; } -ORegKey::ORegKey(const OUString& keyName, ORegistry* pReg) +ORegKey::ORegKey(OUString keyName, ORegistry* pReg) : m_refCount(1) - , m_name(keyName) + , m_name(std::move(keyName)) , m_bDeleted(false) , m_bModified(false) , m_pRegistry(pReg) diff --git a/registry/source/keyimpl.hxx b/registry/source/keyimpl.hxx index 1958a7b6247e..4bfbcec3b7b7 100644 --- a/registry/source/keyimpl.hxx +++ b/registry/source/keyimpl.hxx @@ -31,7 +31,7 @@ class ORegKey { public: - ORegKey(const OUString& keyName, ORegistry* pReg); + ORegKey(OUString keyName, ORegistry* pReg); ~ORegKey(); void acquire() diff --git a/smoketest/smoketest.cxx b/smoketest/smoketest.cxx index 80a29036f19b..3a4f2b1afc86 100644 --- a/smoketest/smoketest.cxx +++ b/smoketest/smoketest.cxx @@ -51,6 +51,7 @@ #include <unotest/gettestargument.hxx> #include <unotest/officeconnection.hxx> #include <unotest/toabsolutefileurl.hxx> +#include <utility> namespace { @@ -93,12 +94,11 @@ class Callback: public cppu::WeakImplHelper< css::awt::XCallback > { public: Callback( css::uno::Reference< css::frame::XNotifyingDispatch > const & dispatch, - css::util::URL const & url, + css::util::URL url, css::uno::Sequence< css::beans::PropertyValue > const & arguments, - css::uno::Reference< css::frame::XDispatchResultListener > const & - listener): - dispatch_(dispatch), url_(url), arguments_(arguments), - listener_(listener) + css::uno::Reference< css::frame::XDispatchResultListener > listener): + dispatch_(dispatch), url_(std::move(url)), arguments_(arguments), + listener_(std::move(listener)) { OSL_ASSERT(dispatch.is()); } private: diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 4963ee2ddcfb..feac0db96227 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -319,8 +319,8 @@ struct PageData class Deallocate { public: - explicit Deallocate(rtl::Reference<Allocator> const & allocator): - allocator_(allocator) {}; + explicit Deallocate(rtl::Reference<Allocator> allocator): + allocator_(std::move(allocator)) {}; void operator ()(void * page) const { allocator_->deallocate(page); } @@ -425,8 +425,8 @@ public: return bool(m_xPage); } - explicit PageHolderObject (std::shared_ptr<PageData> const & rxPage = std::shared_ptr<PageData>()) - : m_xPage (rxPage) + explicit PageHolderObject (std::shared_ptr<PageData> xPage = std::shared_ptr<PageData>()) + : m_xPage (std::move(xPage)) {} void swap (PageHolderObject<T> & rhs) @@ -547,8 +547,8 @@ protected: /** Construction. */ - explicit OStorePageObject (std::shared_ptr<PageData> const & rxPage) - : m_xPage (rxPage), m_bDirty (false) + explicit OStorePageObject (std::shared_ptr<PageData> rxPage) + : m_xPage (std::move(rxPage)), m_bDirty (false) {} /** Destruction. diff --git a/testtools/source/bridgetest/multi.cxx b/testtools/source/bridgetest/multi.cxx index 1bfbfb4154f7..1ac6aa81b135 100644 --- a/testtools/source/bridgetest/multi.cxx +++ b/testtools/source/bridgetest/multi.cxx @@ -27,11 +27,12 @@ #include <sstream> #include <string_view> +#include <utility> namespace { struct CheckFailed { - explicit CheckFailed(OUString const & theMessage): message(theMessage) + explicit CheckFailed(OUString theMessage): message(std::move(theMessage)) {} OUString message; |