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>
This commit is contained in:
Noel Grandin 2022-06-23 15:09:08 +02:00
parent 5bb5763e2f
commit c7c2f6b37a
11 changed files with 37 additions and 30 deletions

View File

@ -21,6 +21,7 @@
#include "basmodnode.hxx" #include "basmodnode.hxx"
#include <com/sun/star/script/browse/BrowseNodeTypes.hpp> #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <utility>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <basic/basmgr.hxx> #include <basic/basmgr.hxx>
#include <basic/sbstar.hxx> #include <basic/sbstar.hxx>
@ -40,13 +41,13 @@ namespace basprov
BasicLibraryNodeImpl::BasicLibraryNodeImpl( const Reference< XComponentContext >& rxContext, BasicLibraryNodeImpl::BasicLibraryNodeImpl( const Reference< XComponentContext >& rxContext,
const OUString& sScriptingContext, BasicManager* pBasicManager, OUString sScriptingContext, BasicManager* pBasicManager,
const Reference< script::XLibraryContainer >& xLibContainer, const OUString& sLibName, bool isAppScript ) const Reference< script::XLibraryContainer >& xLibContainer, OUString sLibName, bool isAppScript )
:m_xContext( rxContext ) :m_xContext( rxContext )
,m_sScriptingContext( sScriptingContext ) ,m_sScriptingContext(std::move( sScriptingContext ))
,m_pBasicManager( pBasicManager ) ,m_pBasicManager( pBasicManager )
,m_xLibContainer( xLibContainer ) ,m_xLibContainer( xLibContainer )
,m_sLibName( sLibName ) ,m_sLibName(std::move( sLibName ))
,m_bIsAppScript( isAppScript ) ,m_bIsAppScript( isAppScript )
{ {
if ( m_xLibContainer.is() ) if ( m_xLibContainer.is() )

View File

@ -50,10 +50,10 @@ namespace basprov
public: public:
BasicLibraryNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext, BasicLibraryNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const OUString& sScriptingContext, OUString sScriptingContext,
BasicManager* pBasicManager, BasicManager* pBasicManager,
const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer, const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer,
const OUString& sLibName, bool isAppScript ); OUString sLibName, bool isAppScript );
virtual ~BasicLibraryNodeImpl() override; virtual ~BasicLibraryNodeImpl() override;
// XBrowseNode // XBrowseNode

View File

@ -25,6 +25,7 @@
#include <com/sun/star/script/browse/BrowseNodeTypes.hpp> #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
#include <comphelper/propertyvalue.hxx> #include <comphelper/propertyvalue.hxx>
#include <utility>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <basic/sbstar.hxx> #include <basic/sbstar.hxx>
#include <basic/sbmeth.hxx> #include <basic/sbmeth.hxx>
@ -57,11 +58,11 @@ namespace basprov
BasicMethodNodeImpl::BasicMethodNodeImpl( const Reference< XComponentContext >& rxContext, BasicMethodNodeImpl::BasicMethodNodeImpl( const Reference< XComponentContext >& rxContext,
const OUString& sScriptingContext, SbMethod* pMethod, bool isAppScript ) OUString sScriptingContext, SbMethod* pMethod, bool isAppScript )
: ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex )
,OPropertyContainer( GetBroadcastHelper() ) ,OPropertyContainer( GetBroadcastHelper() )
,m_xContext( rxContext ) ,m_xContext( rxContext )
,m_sScriptingContext( sScriptingContext ) ,m_sScriptingContext(std::move( sScriptingContext ))
,m_pMethod( pMethod ) ,m_pMethod( pMethod )
,m_bIsAppScript( isAppScript ) ,m_bIsAppScript( isAppScript )
,m_bEditable( true ) ,m_bEditable( true )

View File

@ -69,7 +69,7 @@ namespace basprov
public: public:
BasicMethodNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext, BasicMethodNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const OUString& sScriptingContext, OUString sScriptingContext,
SbMethod* pMethod, bool isAppScript ); SbMethod* pMethod, bool isAppScript );
virtual ~BasicMethodNodeImpl() override; virtual ~BasicMethodNodeImpl() override;

View File

@ -20,6 +20,7 @@
#include "basmodnode.hxx" #include "basmodnode.hxx"
#include "basmethnode.hxx" #include "basmethnode.hxx"
#include <com/sun/star/script/browse/BrowseNodeTypes.hpp> #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
#include <utility>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <basic/sbx.hxx> #include <basic/sbx.hxx>
#include <basic/sbmod.hxx> #include <basic/sbmod.hxx>
@ -40,9 +41,9 @@ namespace basprov
BasicModuleNodeImpl::BasicModuleNodeImpl( const Reference< XComponentContext >& rxContext, BasicModuleNodeImpl::BasicModuleNodeImpl( const Reference< XComponentContext >& rxContext,
const OUString& sScriptingContext, SbModule* pModule, bool isAppScript ) OUString sScriptingContext, SbModule* pModule, bool isAppScript )
:m_xContext( rxContext ) :m_xContext( rxContext )
,m_sScriptingContext( sScriptingContext ) ,m_sScriptingContext(std::move( sScriptingContext ))
,m_pModule( pModule ) ,m_pModule( pModule )
,m_bIsAppScript( isAppScript ) ,m_bIsAppScript( isAppScript )
{ {

View File

@ -46,7 +46,7 @@ namespace basprov
public: public:
BasicModuleNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext, BasicModuleNodeImpl( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const OUString& sScriptingContext, OUString sScriptingContext,
SbModule* pModule, bool isAppScript ); SbModule* pModule, bool isAppScript );
virtual ~BasicModuleNodeImpl() override; virtual ~BasicModuleNodeImpl() override;

View File

@ -18,6 +18,7 @@
*/ */
#include "basscript.hxx" #include "basscript.hxx"
#include <utility>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <basic/sbx.hxx> #include <basic/sbx.hxx>
#include <basic/sbmod.hxx> #include <basic/sbmod.hxx>
@ -54,11 +55,11 @@ constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER = u"Caller";
// BasicScriptImpl // BasicScriptImpl
BasicScriptImpl::BasicScriptImpl( const OUString& funcName, SbMethodRef const & xMethod ) BasicScriptImpl::BasicScriptImpl( OUString funcName, SbMethodRef xMethod )
: ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex )
,OPropertyContainer( GetBroadcastHelper() ) ,OPropertyContainer( GetBroadcastHelper() )
,m_xMethod( xMethod ) ,m_xMethod(std::move( xMethod ))
,m_funcName( funcName ) ,m_funcName(std::move( funcName ))
,m_documentBasicManager( nullptr ) ,m_documentBasicManager( nullptr )
,m_xDocumentScriptContext() ,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 ) BasicManager& documentBasicManager, const Reference< XScriptInvocationContext >& documentScriptContext ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex )
,OPropertyContainer( GetBroadcastHelper() ) ,OPropertyContainer( GetBroadcastHelper() )
,m_xMethod( xMethod ) ,m_xMethod(std::move( xMethod ))
,m_funcName( funcName ) ,m_funcName(std::move( funcName ))
,m_documentBasicManager( &documentBasicManager ) ,m_documentBasicManager( &documentBasicManager )
,m_xDocumentScriptContext( documentScriptContext ) ,m_xDocumentScriptContext( documentScriptContext )
{ {

View File

@ -67,12 +67,12 @@ namespace basprov
public: public:
BasicScriptImpl( BasicScriptImpl(
const OUString& funcName, OUString funcName,
SbMethodRef const & xMethod SbMethodRef xMethod
); );
BasicScriptImpl( BasicScriptImpl(
const OUString& funcName, OUString funcName,
SbMethodRef const & xMethod, SbMethodRef xMethod,
BasicManager& documentBasicManager, BasicManager& documentBasicManager,
const css::uno::Reference< css::document::XScriptInvocationContext >& documentScriptContext const css::uno::Reference< css::document::XScriptInvocationContext >& documentScriptContext
); );

View File

@ -23,6 +23,7 @@
#include <sfx2/strings.hrc> #include <sfx2/strings.hrc>
#include <sfx2/sfxresid.hxx> #include <sfx2/sfxresid.hxx>
#include <utility>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/weld.hxx> #include <vcl/weld.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
@ -102,12 +103,12 @@ namespace dlgprov
Reference< script::XScriptListener > mxListener; Reference< script::XScriptListener > mxListener;
virtual void firing_impl( const script::ScriptEvent& aScriptEvent, uno::Any* pRet ) override; virtual void firing_impl( const script::ScriptEvent& aScriptEvent, uno::Any* pRet ) override;
public: 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() ); Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager() );
Sequence< Any > args(1); Sequence< Any > args(1);
@ -360,10 +361,10 @@ namespace dlgprov
DialogAllListenerImpl::DialogAllListenerImpl( const Reference< XScriptListener >& rxListener, DialogAllListenerImpl::DialogAllListenerImpl( const Reference< XScriptListener >& rxListener,
const OUString& rScriptType, const OUString& rScriptCode ) OUString sScriptType, OUString sScriptCode )
:m_xScriptListener( rxListener ) :m_xScriptListener( rxListener )
,m_sScriptType( rScriptType ) ,m_sScriptType(std::move( sScriptType ))
,m_sScriptCode( rScriptCode ) ,m_sScriptCode(std::move( sScriptCode ))
{ {
} }

View File

@ -32,6 +32,7 @@
#include <com/sun/star/script/XScriptEventsSupplier.hpp> #include <com/sun/star/script/XScriptEventsSupplier.hpp>
#include <unordered_map> #include <unordered_map>
#include <utility>
namespace dlgprov namespace dlgprov
{ {
@ -89,7 +90,7 @@ namespace dlgprov
public: public:
DialogAllListenerImpl( const css::uno::Reference< css::script::XScriptListener >& rxListener, DialogAllListenerImpl( const css::uno::Reference< css::script::XScriptListener >& rxListener,
const OUString& rScriptType, const OUString& rScriptCode ); OUString sScriptType, OUString sScriptCode );
virtual ~DialogAllListenerImpl() override; virtual ~DialogAllListenerImpl() override;
// XEventListener // XEventListener
@ -113,7 +114,7 @@ namespace dlgprov
css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::uno::XComponentContext > m_xContext;
virtual void firing_impl( const css::script::ScriptEvent& aScriptEvent, css::uno::Any* pRet ) = 0; virtual void firing_impl( const css::script::ScriptEvent& aScriptEvent, css::uno::Any* pRet ) = 0;
public: 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; virtual ~DialogScriptListenerImpl() override;
// XEventListener // XEventListener

View File

@ -31,6 +31,7 @@
#include <comphelper/interfacecontainer4.hxx> #include <comphelper/interfacecontainer4.hxx>
#include <mutex> #include <mutex>
#include <unordered_map> #include <unordered_map>
#include <utility>
#include <vector> #include <vector>
@ -67,7 +68,7 @@ struct LocaleItem
bool m_bModified; bool m_bModified;
LocaleItem( css::lang::Locale locale, bool bLoaded=true ) LocaleItem( css::lang::Locale locale, bool bLoaded=true )
: m_locale( locale ) : m_locale(std::move( locale ))
, m_nNextIndex( 0 ) , m_nNextIndex( 0 )
, m_bLoaded( bLoaded ) , m_bLoaded( bLoaded )
, m_bModified( false ) , m_bModified( false )