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 <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() )

View File

@ -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

View File

@ -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 )

View File

@ -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;

View File

@ -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 )
{

View File

@ -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;

View File

@ -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 )
{

View File

@ -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
);

View File

@ -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 ))
{
}

View File

@ -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

View File

@ -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 )