From 80fab1529a5680fcad4075e4363924cfb2f7213a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 21 May 2022 13:09:58 +0200 Subject: clang-tidy modernize-pass-by-value in bridges Change-Id: I6c52316e46117aacb22a2adcb75841aed834041f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134705 Tested-by: Jenkins Reviewed-by: Noel Grandin --- bridges/inc/cppinterfaceproxy.hxx | 2 +- bridges/inc/unointerfaceproxy.hxx | 2 +- bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx | 5 +++-- bridges/source/cpp_uno/shared/unointerfaceproxy.cxx | 5 +++-- bridges/source/jni_uno/jni_base.h | 5 +++-- bridges/source/jni_uno/jni_uno2java.cxx | 7 ++++--- bridges/source/jni_uno/nativethreadpool.cxx | 5 +++-- 7 files changed, 18 insertions(+), 13 deletions(-) (limited to 'bridges') diff --git a/bridges/inc/cppinterfaceproxy.hxx b/bridges/inc/cppinterfaceproxy.hxx index 73175d842df1..5b5c85dc7dd5 100644 --- a/bridges/inc/cppinterfaceproxy.hxx +++ b/bridges/inc/cppinterfaceproxy.hxx @@ -72,7 +72,7 @@ private: CppInterfaceProxy( Bridge * pBridge_, uno_Interface * pUnoI_, typelib_InterfaceTypeDescription * pTypeDescr_, - OUString const & rOId_); + OUString aOId_); ~CppInterfaceProxy(); diff --git a/bridges/inc/unointerfaceproxy.hxx b/bridges/inc/unointerfaceproxy.hxx index b00d6ad61366..d20a7c3549fa 100644 --- a/bridges/inc/unointerfaceproxy.hxx +++ b/bridges/inc/unointerfaceproxy.hxx @@ -76,7 +76,7 @@ private: UnoInterfaceProxy( Bridge * pBridge_, com::sun::star::uno::XInterface * pCppI_, typelib_InterfaceTypeDescription * pTypeDescr_, - OUString const & rOId_); + OUString aOId_); ~UnoInterfaceProxy(); diff --git a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx index e4ee7800a385..dad1ad8f7ac6 100644 --- a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -102,12 +103,12 @@ void CppInterfaceProxy::releaseProxy() CppInterfaceProxy::CppInterfaceProxy( bridges::cpp_uno::shared::Bridge * pBridge_, uno_Interface * pUnoI_, - typelib_InterfaceTypeDescription * pTypeDescr_, OUString const & rOId_) + typelib_InterfaceTypeDescription * pTypeDescr_, OUString aOId_) : nRef( 1 ) , pBridge( pBridge_ ) , pUnoI( pUnoI_ ) , pTypeDescr( pTypeDescr_ ) - , oid( rOId_ ) + , oid(std::move( aOId_ )) { pBridge->acquire(); ::typelib_typedescription_acquire( &pTypeDescr->aBase ); diff --git a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx index 91578e9999d1..3c03c1cffc0f 100644 --- a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -93,12 +94,12 @@ UnoInterfaceProxy * UnoInterfaceProxy::create( UnoInterfaceProxy::UnoInterfaceProxy( bridges::cpp_uno::shared::Bridge * pBridge_, com::sun::star::uno::XInterface * pCppI_, - typelib_InterfaceTypeDescription * pTypeDescr_, OUString const & rOId_) + typelib_InterfaceTypeDescription * pTypeDescr_, OUString aOId_) : nRef( 1 ) , pBridge( pBridge_ ) , pCppI( pCppI_ ) , pTypeDescr( pTypeDescr_ ) - , oid( rOId_ ) + , oid(std::move( aOId_ )) { pBridge->acquire(); ::typelib_typedescription_acquire(&pTypeDescr->aBase); diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h index 696ddd365533..0d02261adb2a 100644 --- a/bridges/source/jni_uno/jni_base.h +++ b/bridges/source/jni_uno/jni_base.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -45,8 +46,8 @@ struct BridgeRuntimeError { OUString m_message; - explicit BridgeRuntimeError( OUString const & message ) - : m_message( message ) + explicit BridgeRuntimeError( OUString message ) + : m_message(std::move( message )) {} }; diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index b8b69789a2ce..8fd38ec31b15 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -30,6 +30,7 @@ #include #include +#include #include "jni_bridge.h" #include "jniunoenvironmentdata.hxx" @@ -401,7 +402,7 @@ struct UNO_proxy : public uno_Interface // ctor inline UNO_proxy( JNI_context const & jni, Bridge const * bridge, - jobject javaI, jstring jo_oid, OUString const & oid, + jobject javaI, jstring jo_oid, OUString oid, JNI_interface_type_info const * info ); }; @@ -409,10 +410,10 @@ struct UNO_proxy : public uno_Interface inline UNO_proxy::UNO_proxy( JNI_context const & jni, Bridge const * bridge, - jobject javaI, jstring jo_oid, OUString const & oid, + jobject javaI, jstring jo_oid, OUString oid, JNI_interface_type_info const * info ) : m_ref( 1 ), - m_oid( oid ), + m_oid(std::move( oid )), m_type_info( info ) { JNI_info const * jni_info = bridge->getJniInfo(); diff --git a/bridges/source/jni_uno/nativethreadpool.cxx b/bridges/source/jni_uno/nativethreadpool.cxx index 4fe4a0a2fb8d..1d14c47bb0ad 100644 --- a/bridges/source/jni_uno/nativethreadpool.cxx +++ b/bridges/source/jni_uno/nativethreadpool.cxx @@ -29,6 +29,7 @@ #include #include +#include /* The native implementation part of * jurt/com/sun/star/lib/uno/environments/remote/NativeThreadPool.java. @@ -37,9 +38,9 @@ namespace { struct Pool { - Pool(rtl::Reference< jvmaccess::VirtualMachine > const & theVirtualMachine, + Pool(rtl::Reference< jvmaccess::VirtualMachine > theVirtualMachine, jmethodID theExecute, uno_ThreadPool thePool): - virtualMachine(theVirtualMachine), execute(theExecute), pool(thePool) {} + virtualMachine(std::move(theVirtualMachine)), execute(theExecute), pool(thePool) {} rtl::Reference< jvmaccess::VirtualMachine > virtualMachine; jmethodID execute; -- cgit