From c60ad041e8f48759062d652ca20216c424768fa4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 2 Jun 2022 10:44:17 +0200 Subject: clang-tidy modernize-pass-by-value in framework Change-Id: I024653154c51389bb27f3e94b422ff7fc1c9b46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135296 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/uiconfiguration/globalsettings.cxx | 11 ++++++----- framework/source/uiconfiguration/imagemanagerimpl.cxx | 11 ++++++----- framework/source/uiconfiguration/imagemanagerimpl.hxx | 4 ++-- .../source/uiconfiguration/moduleuiconfigurationmanager.cxx | 5 +++-- framework/source/uiconfiguration/uiconfigurationmanager.cxx | 11 ++++++----- 5 files changed, 23 insertions(+), 19 deletions(-) (limited to 'framework/source/uiconfiguration') diff --git a/framework/source/uiconfiguration/globalsettings.cxx b/framework/source/uiconfiguration/globalsettings.cxx index b0b6f859c02c..0883cc8af197 100644 --- a/framework/source/uiconfiguration/globalsettings.cxx +++ b/framework/source/uiconfiguration/globalsettings.cxx @@ -29,6 +29,7 @@ #include #include #include +#include // Defines @@ -48,7 +49,7 @@ class GlobalSettings_Access : public ::cppu::WeakImplHelper< css::lang::XEventListener> { public: - explicit GlobalSettings_Access( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + explicit GlobalSettings_Access( css::uno::Reference< css::uno::XComponentContext > xContext ); // XComponent virtual void SAL_CALL dispose() override; @@ -78,14 +79,14 @@ class GlobalSettings_Access : public ::cppu::WeakImplHelper< } -GlobalSettings_Access::GlobalSettings_Access( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : +GlobalSettings_Access::GlobalSettings_Access( css::uno::Reference< css::uno::XComponentContext > xContext ) : m_bDisposed( false ), m_bConfigRead( false ), m_aNodeRefStates( "States" ), m_aPropStatesEnabled( "StatesEnabled" ), m_aPropLocked( "Locked" ), m_aPropDocked( "Docked" ), - m_xContext( rxContext ) + m_xContext(std::move( xContext )) { } @@ -226,8 +227,8 @@ static GlobalSettings_Access* GetGlobalSettings( const css::uno::Reference< css: return pStaticSettings.get(); } -GlobalSettings::GlobalSettings( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : - m_xContext( rxContext ) +GlobalSettings::GlobalSettings( css::uno::Reference< css::uno::XComponentContext > xContext ) : + m_xContext(std::move( xContext )) { } diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index c60e7d3c1dd2..5211e79b96dc 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -18,6 +18,7 @@ */ #include "imagemanagerimpl.hxx" +#include #include #include #include @@ -100,10 +101,10 @@ static GlobalImageList* getGlobalImageList( const uno::Reference< uno::XComponen return pGlobalImageList; } -CmdImageList::CmdImageList( const uno::Reference< uno::XComponentContext >& rxContext, const OUString& aModuleIdentifier ) : +CmdImageList::CmdImageList( uno::Reference< uno::XComponentContext > rxContext, OUString aModuleIdentifier ) : m_bInitialized(false), - m_aModuleIdentifier( aModuleIdentifier ), - m_xContext( rxContext ) + m_aModuleIdentifier(std::move( aModuleIdentifier )), + m_xContext(std::move( rxContext )) { } @@ -473,8 +474,8 @@ CmdImageList* ImageManagerImpl::implts_getDefaultImageList() return m_pDefaultImageList.get(); } -ImageManagerImpl::ImageManagerImpl( const uno::Reference< uno::XComponentContext >& rxContext,::cppu::OWeakObject* pOwner,bool _bUseGlobal ) : - m_xContext( rxContext ) +ImageManagerImpl::ImageManagerImpl( uno::Reference< uno::XComponentContext > xContext, ::cppu::OWeakObject* pOwner, bool _bUseGlobal ) : + m_xContext(std::move( xContext )) , m_pOwner(pOwner) , m_aResourceString( "private:resource/images/moduleimages" ) , m_bUseGlobal(_bUseGlobal) diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx b/framework/source/uiconfiguration/imagemanagerimpl.hxx index 88f4a8349398..f36c9fff74c7 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.hxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx @@ -44,7 +44,7 @@ namespace framework class CmdImageList { public: - CmdImageList(const css::uno::Reference< css::uno::XComponentContext >& rxContext, const OUString& aModuleIdentifier); + CmdImageList(css::uno::Reference< css::uno::XComponentContext > xContext, OUString aModuleIdentifier); virtual ~CmdImageList(); virtual Image getImageFromCommandURL(vcl::ImageType nImageType, const OUString& rCommandURL); @@ -76,7 +76,7 @@ namespace framework class ImageManagerImpl { public: - ImageManagerImpl(const css::uno::Reference< css::uno::XComponentContext >& rxContext + ImageManagerImpl(css::uno::Reference< css::uno::XComponentContext > xContext ,::cppu::OWeakObject *pOwner ,bool _bUseGlobal); ~ImageManagerImpl(); diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 8e1e4dbb2660..93058358d04a 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -155,8 +156,8 @@ private: struct UIElementInfo { - UIElementInfo( const OUString& rResourceURL, const OUString& rUIName ) : - aResourceURL( rResourceURL), aUIName( rUIName ) {} + UIElementInfo( OUString _aResourceURL, OUString _aUIName ) : + aResourceURL(std::move( _aResourceURL)), aUIName(std::move( _aUIName )) {} OUString aResourceURL; OUString aUIName; }; diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index 3e7cbd74b44f..42f6269bf3ce 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -90,7 +91,7 @@ public: return {"com.sun.star.ui.UIConfigurationManager"}; } - explicit UIConfigurationManager( const css::uno::Reference< css::uno::XComponentContext > & rxContext ); + explicit UIConfigurationManager( css::uno::Reference< css::uno::XComponentContext > xContext ); // XComponent virtual void SAL_CALL dispose() override; @@ -136,8 +137,8 @@ private: struct UIElementInfo { - UIElementInfo( const OUString& rResourceURL, const OUString& rUIName ) : - aResourceURL( rResourceURL), aUIName( rUIName ) {} + UIElementInfo( OUString _aResourceURL, OUString _aUIName ) : + aResourceURL(std::move( _aResourceURL)), aUIName(std::move( _aUIName )) {} OUString aResourceURL; OUString aUIName; }; @@ -670,12 +671,12 @@ void UIConfigurationManager::impl_Initialize() } } -UIConfigurationManager::UIConfigurationManager( const css::uno::Reference< css::uno::XComponentContext > & rxContext ) : +UIConfigurationManager::UIConfigurationManager( css::uno::Reference< css::uno::XComponentContext > xContext ) : m_bReadOnly( true ) , m_bModified( false ) , m_bDisposed( false ) , m_aPropUIName( "UIName" ) - , m_xContext( rxContext ) + , m_xContext(std::move( xContext )) { // Make sure we have a default initialized entry for every layer and user interface element type! // The following code depends on this! -- cgit