diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-23 15:09:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-23 18:24:07 +0200 |
commit | c7c2f6b37a834a3135e3683f1fc27f3ec938640c (patch) | |
tree | 5f2e849fa01674918760872259db95bc436fe427 | |
parent | 5bb5763e2f208cddd114fe96466bdfa2ed3bdbf3 (diff) |
clang-tidy modernize-pass-by-value in scripting
Change-Id: I95e2a391a984905cac5cbf3f1bb640e1157fafd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | scripting/source/basprov/baslibnode.cxx | 9 | ||||
-rw-r--r-- | scripting/source/basprov/baslibnode.hxx | 4 | ||||
-rw-r--r-- | scripting/source/basprov/basmethnode.cxx | 5 | ||||
-rw-r--r-- | scripting/source/basprov/basmethnode.hxx | 2 | ||||
-rw-r--r-- | scripting/source/basprov/basmodnode.cxx | 5 | ||||
-rw-r--r-- | scripting/source/basprov/basmodnode.hxx | 2 | ||||
-rw-r--r-- | scripting/source/basprov/basscript.cxx | 13 | ||||
-rw-r--r-- | scripting/source/basprov/basscript.hxx | 8 | ||||
-rw-r--r-- | scripting/source/dlgprov/dlgevtatt.cxx | 11 | ||||
-rw-r--r-- | scripting/source/dlgprov/dlgevtatt.hxx | 5 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.hxx | 3 |
11 files changed, 37 insertions, 30 deletions
diff --git a/scripting/source/basprov/baslibnode.cxx b/scripting/source/basprov/baslibnode.cxx index 33942c6b206c..9d6511dfcac3 100644 --- a/scripting/source/basprov/baslibnode.cxx +++ b/scripting/source/basprov/baslibnode.cxx @@ -21,6 +21,7 @@ #include "basmodnode.hxx" #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> #include <comphelper/sequence.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <basic/basmgr.hxx> #include <basic/sbstar.hxx> @@ -40,13 +41,13 @@ namespace basprov BasicLibraryNodeImpl::BasicLibraryNodeImpl( const Reference< XComponentContext >& rxContext, - const OUString& sScriptingContext, BasicManager* pBasicManager, - const Reference< script::XLibraryContainer >& xLibContainer, const OUString& sLibName, bool isAppScript ) + OUString sScriptingContext, BasicManager* pBasicManager, + const Reference< script::XLibraryContainer >& xLibContainer, OUString sLibName, bool isAppScript ) :m_xContext( rxContext ) - ,m_sScriptingContext( sScriptingContext ) + ,m_sScriptingContext(std::move( sScriptingContext )) ,m_pBasicManager( pBasicManager ) ,m_xLibContainer( xLibContainer ) - ,m_sLibName( sLibName ) + ,m_sLibName(std::move( sLibName )) ,m_bIsAppScript( isAppScript ) { if ( m_xLibContainer.is() ) diff --git a/scripting/source/basprov/baslibnode.hxx b/scripting/source/basprov/baslibnode.hxx index 46d31aae58e5..929ad05b9354 100644 --- a/scripting/source/basprov/baslibnode.hxx +++ b/scripting/source/basprov/baslibnode.hxx @@ -50,10 +50,10 @@ namespace basprov public: BasicLibraryNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const OUString& sScriptingContext, + OUString sScriptingContext, BasicManager* pBasicManager, const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer, - const OUString& sLibName, bool isAppScript ); + OUString sLibName, bool isAppScript ); virtual ~BasicLibraryNodeImpl() override; // XBrowseNode diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx index fca2cafe8d72..168d297e48de 100644 --- a/scripting/source/basprov/basmethnode.cxx +++ b/scripting/source/basprov/basmethnode.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> #include <comphelper/propertyvalue.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <basic/sbstar.hxx> #include <basic/sbmeth.hxx> @@ -57,11 +58,11 @@ namespace basprov BasicMethodNodeImpl::BasicMethodNodeImpl( const Reference< XComponentContext >& rxContext, - const OUString& sScriptingContext, SbMethod* pMethod, bool isAppScript ) + OUString sScriptingContext, SbMethod* pMethod, bool isAppScript ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) ,OPropertyContainer( GetBroadcastHelper() ) ,m_xContext( rxContext ) - ,m_sScriptingContext( sScriptingContext ) + ,m_sScriptingContext(std::move( sScriptingContext )) ,m_pMethod( pMethod ) ,m_bIsAppScript( isAppScript ) ,m_bEditable( true ) diff --git a/scripting/source/basprov/basmethnode.hxx b/scripting/source/basprov/basmethnode.hxx index d1eddada026b..d1b08d837a90 100644 --- a/scripting/source/basprov/basmethnode.hxx +++ b/scripting/source/basprov/basmethnode.hxx @@ -69,7 +69,7 @@ namespace basprov public: BasicMethodNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const OUString& sScriptingContext, + OUString sScriptingContext, SbMethod* pMethod, bool isAppScript ); virtual ~BasicMethodNodeImpl() override; diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx index 986e3062d5cd..0ed8e91a9f97 100644 --- a/scripting/source/basprov/basmodnode.cxx +++ b/scripting/source/basprov/basmodnode.cxx @@ -20,6 +20,7 @@ #include "basmodnode.hxx" #include "basmethnode.hxx" #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> +#include <utility> #include <vcl/svapp.hxx> #include <basic/sbx.hxx> #include <basic/sbmod.hxx> @@ -40,9 +41,9 @@ namespace basprov BasicModuleNodeImpl::BasicModuleNodeImpl( const Reference< XComponentContext >& rxContext, - const OUString& sScriptingContext, SbModule* pModule, bool isAppScript ) + OUString sScriptingContext, SbModule* pModule, bool isAppScript ) :m_xContext( rxContext ) - ,m_sScriptingContext( sScriptingContext ) + ,m_sScriptingContext(std::move( sScriptingContext )) ,m_pModule( pModule ) ,m_bIsAppScript( isAppScript ) { diff --git a/scripting/source/basprov/basmodnode.hxx b/scripting/source/basprov/basmodnode.hxx index ebf0957ef044..d34e709b2884 100644 --- a/scripting/source/basprov/basmodnode.hxx +++ b/scripting/source/basprov/basmodnode.hxx @@ -46,7 +46,7 @@ namespace basprov public: BasicModuleNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const OUString& sScriptingContext, + OUString sScriptingContext, SbModule* pModule, bool isAppScript ); virtual ~BasicModuleNodeImpl() override; diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index b5a3f6136534..f3ab8d2dd224 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -18,6 +18,7 @@ */ #include "basscript.hxx" +#include <utility> #include <vcl/svapp.hxx> #include <basic/sbx.hxx> #include <basic/sbmod.hxx> @@ -54,11 +55,11 @@ constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER = u"Caller"; // BasicScriptImpl - BasicScriptImpl::BasicScriptImpl( const OUString& funcName, SbMethodRef const & xMethod ) + BasicScriptImpl::BasicScriptImpl( OUString funcName, SbMethodRef xMethod ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) ,OPropertyContainer( GetBroadcastHelper() ) - ,m_xMethod( xMethod ) - ,m_funcName( funcName ) + ,m_xMethod(std::move( xMethod )) + ,m_funcName(std::move( funcName )) ,m_documentBasicManager( nullptr ) ,m_xDocumentScriptContext() { @@ -66,11 +67,11 @@ constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER = u"Caller"; } - BasicScriptImpl::BasicScriptImpl( const OUString& funcName, SbMethodRef const & xMethod, + BasicScriptImpl::BasicScriptImpl( OUString funcName, SbMethodRef xMethod, BasicManager& documentBasicManager, const Reference< XScriptInvocationContext >& documentScriptContext ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) ,OPropertyContainer( GetBroadcastHelper() ) - ,m_xMethod( xMethod ) - ,m_funcName( funcName ) + ,m_xMethod(std::move( xMethod )) + ,m_funcName(std::move( funcName )) ,m_documentBasicManager( &documentBasicManager ) ,m_xDocumentScriptContext( documentScriptContext ) { diff --git a/scripting/source/basprov/basscript.hxx b/scripting/source/basprov/basscript.hxx index d0f9e6e7af85..e7a94d706ee7 100644 --- a/scripting/source/basprov/basscript.hxx +++ b/scripting/source/basprov/basscript.hxx @@ -67,12 +67,12 @@ namespace basprov public: BasicScriptImpl( - const OUString& funcName, - SbMethodRef const & xMethod + OUString funcName, + SbMethodRef xMethod ); BasicScriptImpl( - const OUString& funcName, - SbMethodRef const & xMethod, + OUString funcName, + SbMethodRef xMethod, BasicManager& documentBasicManager, const css::uno::Reference< css::document::XScriptInvocationContext >& documentScriptContext ); diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx index 704518e07aef..2d5d5e17cdf2 100644 --- a/scripting/source/dlgprov/dlgevtatt.cxx +++ b/scripting/source/dlgprov/dlgevtatt.cxx @@ -23,6 +23,7 @@ #include <sfx2/strings.hrc> #include <sfx2/sfxresid.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <tools/diagnose_ex.h> @@ -102,12 +103,12 @@ namespace dlgprov Reference< script::XScriptListener > mxListener; virtual void firing_impl( const script::ScriptEvent& aScriptEvent, uno::Any* pRet ) override; public: - DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel, const OUString& sDialogLibName ); + DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel, OUString sDialogLibName ); }; } - DialogVBAScriptListenerImpl::DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel, const OUString& sDialogLibName ) : DialogScriptListenerImpl( rxContext ), msDialogLibName( sDialogLibName ) + DialogVBAScriptListenerImpl::DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel, OUString sDialogLibName ) : DialogScriptListenerImpl( rxContext ), msDialogLibName(std::move( sDialogLibName )) { Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager() ); Sequence< Any > args(1); @@ -360,10 +361,10 @@ namespace dlgprov DialogAllListenerImpl::DialogAllListenerImpl( const Reference< XScriptListener >& rxListener, - const OUString& rScriptType, const OUString& rScriptCode ) + OUString sScriptType, OUString sScriptCode ) :m_xScriptListener( rxListener ) - ,m_sScriptType( rScriptType ) - ,m_sScriptCode( rScriptCode ) + ,m_sScriptType(std::move( sScriptType )) + ,m_sScriptCode(std::move( sScriptCode )) { } diff --git a/scripting/source/dlgprov/dlgevtatt.hxx b/scripting/source/dlgprov/dlgevtatt.hxx index 239cb653040a..62a131de03a9 100644 --- a/scripting/source/dlgprov/dlgevtatt.hxx +++ b/scripting/source/dlgprov/dlgevtatt.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/script/XScriptEventsSupplier.hpp> #include <unordered_map> +#include <utility> namespace dlgprov { @@ -89,7 +90,7 @@ namespace dlgprov public: DialogAllListenerImpl( const css::uno::Reference< css::script::XScriptListener >& rxListener, - const OUString& rScriptType, const OUString& rScriptCode ); + OUString sScriptType, OUString sScriptCode ); virtual ~DialogAllListenerImpl() override; // XEventListener @@ -113,7 +114,7 @@ namespace dlgprov css::uno::Reference< css::uno::XComponentContext > m_xContext; virtual void firing_impl( const css::script::ScriptEvent& aScriptEvent, css::uno::Any* pRet ) = 0; public: - explicit DialogScriptListenerImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : m_xContext( rxContext ) {} + explicit DialogScriptListenerImpl( css::uno::Reference< css::uno::XComponentContext > xContext ) : m_xContext(std::move( xContext )) {} virtual ~DialogScriptListenerImpl() override; // XEventListener diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx index 7722da62f28d..50fd8567e0e6 100644 --- a/scripting/source/stringresource/stringresource.hxx +++ b/scripting/source/stringresource/stringresource.hxx @@ -31,6 +31,7 @@ #include <comphelper/interfacecontainer4.hxx> #include <mutex> #include <unordered_map> +#include <utility> #include <vector> @@ -67,7 +68,7 @@ struct LocaleItem bool m_bModified; LocaleItem( css::lang::Locale locale, bool bLoaded=true ) - : m_locale( locale ) + : m_locale(std::move( locale )) , m_nNextIndex( 0 ) , m_bLoaded( bLoaded ) , m_bModified( false ) |