summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-08-02 13:09:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-02 21:33:36 +0200
commit566d6accfc443915e6f741e5cb7b8cf244dd7c8b (patch)
tree215b860848d7b0fe914a3c9ada820421800db70c /toolkit
parent8690d8878248320b0b706e9d6f7b8fa89ed903c4 (diff)
clang-tidy modernize-pass-by-value in toolkit
Change-Id: I51823060a967b5c9f304af587ed4f9c262734be9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137690 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/controls/geometrycontrolmodel.hxx2
-rw-r--r--toolkit/inc/helper/msgbox.hxx2
-rw-r--r--toolkit/source/awt/asynccallback.cxx5
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx5
-rw-r--r--toolkit/source/awt/vclxwindow.cxx5
-rw-r--r--toolkit/source/controls/geometrycontrolmodel.cxx5
-rw-r--r--toolkit/source/controls/tree/treedatamodel.cxx9
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx11
-rw-r--r--toolkit/source/controls/unocontrols.cxx5
-rw-r--r--toolkit/source/hatchwindow/documentcloser.cxx5
-rw-r--r--toolkit/source/helper/property.cxx5
11 files changed, 34 insertions, 25 deletions
diff --git a/toolkit/inc/controls/geometrycontrolmodel.hxx b/toolkit/inc/controls/geometrycontrolmodel.hxx
index d6b204b197fa..c2dc13b49f3f 100644
--- a/toolkit/inc/controls/geometrycontrolmodel.hxx
+++ b/toolkit/inc/controls/geometrycontrolmodel.hxx
@@ -221,7 +221,7 @@ namespace com::sun::star {
*/
OCommonGeometryControlModel(
css::uno::Reference< css::util::XCloneable >& _rxAgg,
- const OUString& _rxServiceSpecifier
+ OUString _aServiceSpecifier
);
// OIdPropertyArrayUsageHelper overridables
diff --git a/toolkit/inc/helper/msgbox.hxx b/toolkit/inc/helper/msgbox.hxx
index cef129cf4517..9259719ce3a2 100644
--- a/toolkit/inc/helper/msgbox.hxx
+++ b/toolkit/inc/helper/msgbox.hxx
@@ -62,7 +62,7 @@ protected:
public:
MessBox(vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits n, const OUString& rTitle,
- const OUString& rMessage);
+ OUString rMessage);
virtual ~MessBox() override;
virtual void dispose() override;
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx
index 751647447092..f6804d9c2366 100644
--- a/toolkit/source/awt/asynccallback.cxx
+++ b/toolkit/source/awt/asynccallback.cxx
@@ -19,6 +19,7 @@
#include <sal/config.h>
+#include <utility>
#include <vcl/svapp.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -51,8 +52,8 @@ private:
struct CallbackData
{
- CallbackData( const css::uno::Reference< css::awt::XCallback >& rCallback, const css::uno::Any& rAny ) :
- xCallback( rCallback ), aData( rAny ) {}
+ CallbackData( css::uno::Reference< css::awt::XCallback > _xCallback, css::uno::Any aAny ) :
+ xCallback(std::move( _xCallback )), aData(std::move( aAny )) {}
css::uno::Reference< css::awt::XCallback > xCallback;
css::uno::Any aData;
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index a2e98ff17202..67e33e8bc3db 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -69,6 +69,7 @@
#include <postmac.h>
#endif
+#include <utility>
#include <vcl/sysdata.hxx>
#include <vcl/textrectinfo.hxx>
#include <vcl/toolkit/vclmedit.hxx>
@@ -227,11 +228,11 @@ void MessBox::ImplInitButtons()
}
MessBox::MessBox(vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits nWinBits,
- const OUString& rTitle, const OUString& rMessage) :
+ const OUString& rTitle, OUString aMessage) :
ButtonDialog( WindowType::MESSBOX ),
mbHelpBtn( false ),
mnMessBoxStyle( nMessBoxStyle ),
- maMessText( rMessage )
+ maMessText(std::move( aMessage ))
{
ImplLOKNotifier(pParent);
ImplInitDialog(pParent, nWinBits | WB_MOVEABLE | WB_HORZ | WB_CENTER);
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index d3252dd7ad2c..6f34c7bdcc88 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -40,6 +40,7 @@
#include <toolkit/helper/property.hxx>
#include <rtl/math.hxx>
#include <sal/log.hxx>
+#include <utility>
#include <vcl/toolkit/floatwin.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
@@ -404,10 +405,10 @@ namespace
{
struct CallWindow2Listener
{
- CallWindow2Listener( ::comphelper::OInterfaceContainerHelper3<css::awt::XWindowListener2>& i_rWindow2Listeners, const bool i_bEnabled, const EventObject& i_rEvent )
+ CallWindow2Listener( ::comphelper::OInterfaceContainerHelper3<css::awt::XWindowListener2>& i_rWindow2Listeners, const bool i_bEnabled, EventObject i_Event )
:m_rWindow2Listeners( i_rWindow2Listeners )
,m_bEnabled( i_bEnabled )
- ,m_aEvent( i_rEvent )
+ ,m_aEvent(std::move( i_Event ))
{
}
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx
index c201d9b15918..41dec5b57e14 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -26,6 +26,7 @@
#include <toolkit/helper/property.hxx>
#include <algorithm>
#include <functional>
+#include <utility>
#define GCM_PROPERTY_ID_POS_X 1
@@ -455,9 +456,9 @@ constexpr OUStringLiteral GCM_PROPERTY_RESOURCERESOLVER = u"ResourceResolver";
// service specifier.
- OCommonGeometryControlModel::OCommonGeometryControlModel( Reference< XCloneable >& _rxAgg, const OUString& _rServiceSpecifier )
+ OCommonGeometryControlModel::OCommonGeometryControlModel( Reference< XCloneable >& _rxAgg, OUString _aServiceSpecifier )
:OGeometryControlModel_Base( _rxAgg )
- ,m_sServiceSpecifier( _rServiceSpecifier )
+ ,m_sServiceSpecifier(std::move( _aServiceSpecifier ))
,m_nPropertyMapId( 0 )
{
Reference< XPropertySetInfo > xPI;
diff --git a/toolkit/source/controls/tree/treedatamodel.cxx b/toolkit/source/controls/tree/treedatamodel.cxx
index df8056057a8b..090a6738f517 100644
--- a/toolkit/source/controls/tree/treedatamodel.cxx
+++ b/toolkit/source/controls/tree/treedatamodel.cxx
@@ -28,6 +28,7 @@
#include <rtl/ref.hxx>
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
#include <mutex>
+#include <utility>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -81,7 +82,7 @@ class MutableTreeNode: public ::cppu::WeakAggImplHelper2< XMutableTreeNode, XSer
friend class MutableTreeDataModel;
public:
- MutableTreeNode( const rtl::Reference< MutableTreeDataModel >& xModel, const Any& rValue, bool bChildrenOnDemand );
+ MutableTreeNode( rtl::Reference< MutableTreeDataModel > xModel, Any aValue, bool bChildrenOnDemand );
virtual ~MutableTreeNode() override;
void setParent( MutableTreeNode* pParent );
@@ -247,11 +248,11 @@ Sequence< OUString > SAL_CALL MutableTreeDataModel::getSupportedServiceNames( )
return aSeq;
}
-MutableTreeNode::MutableTreeNode( const rtl::Reference< MutableTreeDataModel >& xModel, const Any& rValue, bool bChildrenOnDemand )
-: maDisplayValue( rValue )
+MutableTreeNode::MutableTreeNode( rtl::Reference< MutableTreeDataModel > xModel, Any aValue, bool bChildrenOnDemand )
+: maDisplayValue(std::move( aValue ))
, mbHasChildrenOnDemand( bChildrenOnDemand )
, mpParent( nullptr )
-, mxModel( xModel )
+, mxModel(std::move( xModel ))
, mbIsInserted( false )
{
}
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index 806ec486369b..feb117b4cd3c 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -34,6 +34,7 @@
#include <map>
#include <memory>
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
+#include <utility>
using namespace ::com::sun::star;
@@ -47,9 +48,9 @@ struct UnoControlHolder
OUString msName;
public:
- UnoControlHolder( const OUString& rName, const uno::Reference< awt::XControl > & rControl )
- : mxControl( rControl ),
- msName( rName )
+ UnoControlHolder( OUString aName, uno::Reference< awt::XControl > xControl )
+ : mxControl(std::move( xControl )),
+ msName(std::move( aName ))
{
}
@@ -334,8 +335,8 @@ private:
uno::Reference< awt::XControlContainer > mxControlContainer;
public:
- explicit DialogStepChangedListener( uno::Reference< awt::XControlContainer > const & xControlContainer )
- : mxControlContainer( xControlContainer ) {}
+ explicit DialogStepChangedListener( uno::Reference< awt::XControlContainer > xControlContainer )
+ : mxControlContainer(std::move( xControlContainer )) {}
// XEventListener
virtual void SAL_CALL disposing( const lang::EventObject& Source ) override;
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index e728103d0b28..e5a6197b13d4 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -47,6 +47,7 @@
#include <helper/imagealign.hxx>
#include <helper/unopropertyarrayhelper.hxx>
+#include <utility>
using namespace css;
using namespace css::awt;
@@ -1931,8 +1932,8 @@ struct ListItem
{
}
- explicit ListItem( const OUString& i_rItemText )
- :ItemText( i_rItemText )
+ explicit ListItem( OUString i_ItemText )
+ :ItemText(std::move( i_ItemText ))
{
}
};
diff --git a/toolkit/source/hatchwindow/documentcloser.cxx b/toolkit/source/hatchwindow/documentcloser.cxx
index b83825cdfc08..800703baa59b 100644
--- a/toolkit/source/hatchwindow/documentcloser.cxx
+++ b/toolkit/source/hatchwindow/documentcloser.cxx
@@ -28,6 +28,7 @@
#include <cppuhelper/implbase.hxx>
#include <comphelper/interfacecontainer4.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/dialoghelper.hxx>
#include <vcl/window.hxx>
@@ -68,8 +69,8 @@ class MainThreadFrameCloserRequest
uno::Reference< frame::XFrame > m_xFrame;
public:
- explicit MainThreadFrameCloserRequest( const uno::Reference< frame::XFrame >& xFrame )
- : m_xFrame( xFrame )
+ explicit MainThreadFrameCloserRequest( uno::Reference< frame::XFrame > xFrame )
+ : m_xFrame(std::move( xFrame ))
{}
DECL_STATIC_LINK( MainThreadFrameCloserRequest, worker, void*, void );
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index cdcba6f2dde0..4fe5e9bba471 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <algorithm>
#include <string_view>
+#include <utility>
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
@@ -56,9 +57,9 @@ struct ImplPropertyInfo
sal_Int16 nAttribs;
bool bDependsOnOthers; // eg. VALUE depends on MIN/MAX and must be set after MIN/MAX.
- ImplPropertyInfo( OUString const & theName, sal_uInt16 nId, const css::uno::Type& rType,
+ ImplPropertyInfo( OUString theName, sal_uInt16 nId, const css::uno::Type& rType,
sal_Int16 nAttrs, bool bDepends = false )
- : aName(theName)
+ : aName(std::move(theName))
, nPropId(nId)
, aType(rType)
, nAttribs(nAttrs)