diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-13 13:13:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-13 16:04:27 +0200 |
commit | b7c260aee331474d993bf96a72bf31f5af350ef3 (patch) | |
tree | dd054c07c69e2f711ecea8ebea3e7c78db34917d /chart2/source/tools | |
parent | 24d15ba86c00178238f3f8ef6c548a0d19338aa4 (diff) |
clang-tidy modernize-pass-by-value in chart2
Change-Id: I73ae444487571fb61a02a2c813c060d269d52a02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135723
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r-- | chart2/source/tools/ControllerLockGuard.cxx | 9 | ||||
-rw-r--r-- | chart2/source/tools/DataSeriesHelper.cxx | 5 | ||||
-rw-r--r-- | chart2/source/tools/LabeledDataSequence.cxx | 13 | ||||
-rw-r--r-- | chart2/source/tools/ObjectIdentifier.cxx | 5 | ||||
-rw-r--r-- | chart2/source/tools/PropertyHelper.cxx | 9 | ||||
-rw-r--r-- | chart2/source/tools/UncachedDataSequence.cxx | 17 | ||||
-rw-r--r-- | chart2/source/tools/WrappedDefaultProperty.cxx | 5 | ||||
-rw-r--r-- | chart2/source/tools/WrappedProperty.cxx | 7 |
8 files changed, 39 insertions, 31 deletions
diff --git a/chart2/source/tools/ControllerLockGuard.cxx b/chart2/source/tools/ControllerLockGuard.cxx index 9ae942a5a5ff..f336963e3d49 100644 --- a/chart2/source/tools/ControllerLockGuard.cxx +++ b/chart2/source/tools/ControllerLockGuard.cxx @@ -19,6 +19,7 @@ #include <ControllerLockGuard.hxx> #include <ChartModel.hxx> +#include <utility> using namespace ::com::sun::star; @@ -27,8 +28,8 @@ using ::com::sun::star::uno::Reference; namespace chart { -ControllerLockGuardUNO::ControllerLockGuardUNO( const rtl::Reference<::chart::ChartModel>& xModel ) : - mxModel( xModel ) +ControllerLockGuardUNO::ControllerLockGuardUNO( rtl::Reference<::chart::ChartModel> xModel ) : + mxModel(std::move( xModel )) { mxModel->lockControllers(); } @@ -49,8 +50,8 @@ ControllerLockGuard::~ControllerLockGuard() mrModel.unlockControllers(); } -ControllerLockHelper::ControllerLockHelper( const rtl::Reference<::chart::ChartModel> & xModel ) : - m_xModel( xModel ) +ControllerLockHelper::ControllerLockHelper( rtl::Reference<::chart::ChartModel> xModel ) : + m_xModel(std::move( xModel )) {} ControllerLockHelper::~ControllerLockHelper() diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index a4b4dec45ad0..2b15c9a863a8 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -43,6 +43,7 @@ #include <algorithm> #include <iterator> +#include <utility> #include <vector> #include <set> @@ -58,8 +59,8 @@ namespace class lcl_MatchesRole { public: - explicit lcl_MatchesRole( const OUString & aRole, bool bMatchPrefix ) : - m_aRole( aRole ), + explicit lcl_MatchesRole( OUString aRole, bool bMatchPrefix ) : + m_aRole(std::move( aRole )), m_bMatchPrefix( bMatchPrefix ) {} diff --git a/chart2/source/tools/LabeledDataSequence.cxx b/chart2/source/tools/LabeledDataSequence.cxx index 9557f05aef3e..bf7b13443d1d 100644 --- a/chart2/source/tools/LabeledDataSequence.cxx +++ b/chart2/source/tools/LabeledDataSequence.cxx @@ -20,6 +20,7 @@ #include <LabeledDataSequence.hxx> #include <ModifyListenerHelper.hxx> #include <cppuhelper/supportsservice.hxx> +#include <utility> namespace com::sun::star::uno { class XComponentContext; } @@ -36,18 +37,18 @@ LabeledDataSequence::LabeledDataSequence() : {} LabeledDataSequence::LabeledDataSequence( - const uno::Reference< chart2::data::XDataSequence > & rValues ) : - m_xData( rValues ), + uno::Reference< chart2::data::XDataSequence > xValues ) : + m_xData(std::move( xValues )), m_xModifyEventForwarder( new ModifyEventForwarder() ) { ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder ); } LabeledDataSequence::LabeledDataSequence( - const uno::Reference< chart2::data::XDataSequence > & rValues, - const uno::Reference< chart2::data::XDataSequence > & rLabel ) : - m_xData( rValues ), - m_xLabel( rLabel ), + uno::Reference< chart2::data::XDataSequence > xValues, + uno::Reference< chart2::data::XDataSequence > xLabel ) : + m_xData(std::move( xValues )), + m_xLabel(std::move( xLabel )), m_xModifyEventForwarder( new ModifyEventForwarder() ) { ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder ); diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 8bc65422c463..38bbdebe3aed 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -45,6 +45,7 @@ #include <tools/diagnose_ex.h> #include <o3tl/safeint.hxx> #include <o3tl/string_view.hxx> +#include <utility> namespace com::sun::star::drawing { class XShape; } @@ -235,8 +236,8 @@ ObjectIdentifier::ObjectIdentifier() { } -ObjectIdentifier::ObjectIdentifier( const OUString& rObjectCID ) - :m_aObjectCID( rObjectCID ) +ObjectIdentifier::ObjectIdentifier( OUString aObjectCID ) + :m_aObjectCID(std::move( aObjectCID )) { } diff --git a/chart2/source/tools/PropertyHelper.cxx b/chart2/source/tools/PropertyHelper.cxx index 9f34ba1c2d70..c8f6a4c3fa2e 100644 --- a/chart2/source/tools/PropertyHelper.cxx +++ b/chart2/source/tools/PropertyHelper.cxx @@ -25,6 +25,7 @@ #include <tools/diagnose_ex.h> #include <o3tl/string_view.hxx> +#include <utility> #include <vector> #include <algorithm> #include <iterator> @@ -38,8 +39,8 @@ namespace { struct lcl_EqualsElement { - explicit lcl_EqualsElement( const Any & rValue, const Reference< container::XNameAccess > & xAccess ) - : m_aValue( rValue ), m_xAccess( xAccess ) + explicit lcl_EqualsElement( Any rValue, const Reference< container::XNameAccess > & xAccess ) + : m_aValue(std::move( rValue )), m_xAccess( xAccess ) { OSL_ASSERT( m_xAccess.is()); } @@ -64,8 +65,8 @@ private: struct lcl_StringMatches { - explicit lcl_StringMatches( const OUString & rCmpStr ) : - m_aCmpStr( rCmpStr ) + explicit lcl_StringMatches( OUString aCmpStr ) : + m_aCmpStr(std::move( aCmpStr )) {} bool operator() ( std::u16string_view rStr ) diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx index b07fc11ad9f2..ddf80d52b221 100644 --- a/chart2/source/tools/UncachedDataSequence.cxx +++ b/chart2/source/tools/UncachedDataSequence.cxx @@ -26,6 +26,7 @@ #include <algorithm> #include <strings.hrc> #include <ResId.hxx> +#include <utility> using namespace ::com::sun::star; @@ -54,27 +55,27 @@ namespace chart { UncachedDataSequence::UncachedDataSequence( - const rtl::Reference< InternalDataProvider > & xIntDataProv, - const OUString & rRangeRepresentation ) + rtl::Reference< InternalDataProvider > xIntDataProv, + OUString aRangeRepresentation ) : OPropertyContainer( GetBroadcastHelper()), UncachedDataSequence_Base( GetMutex()), m_nNumberFormatKey(0), - m_xDataProvider( xIntDataProv ), - m_aSourceRepresentation( rRangeRepresentation ), + m_xDataProvider(std::move( xIntDataProv )), + m_aSourceRepresentation(std::move( aRangeRepresentation )), m_xModifyEventForwarder( new ModifyEventForwarder() ) { registerProperties(); } UncachedDataSequence::UncachedDataSequence( - const rtl::Reference< InternalDataProvider > & xIntDataProv, - const OUString & rRangeRepresentation, + rtl::Reference< InternalDataProvider > xIntDataProv, + OUString aRangeRepresentation, const OUString & rRole ) : OPropertyContainer( GetBroadcastHelper()), UncachedDataSequence_Base( GetMutex()), m_nNumberFormatKey(0), - m_xDataProvider( xIntDataProv ), - m_aSourceRepresentation( rRangeRepresentation ), + m_xDataProvider(std::move( xIntDataProv )), + m_aSourceRepresentation(std::move( aRangeRepresentation )), m_xModifyEventForwarder( new ModifyEventForwarder() ) { registerProperties(); diff --git a/chart2/source/tools/WrappedDefaultProperty.cxx b/chart2/source/tools/WrappedDefaultProperty.cxx index 74d2b4b0aae0..f47a8efdbe43 100644 --- a/chart2/source/tools/WrappedDefaultProperty.cxx +++ b/chart2/source/tools/WrappedDefaultProperty.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> +#include <utility> using namespace ::com::sun::star; @@ -32,9 +33,9 @@ namespace chart WrappedDefaultProperty::WrappedDefaultProperty( const OUString& rOuterName, const OUString& rInnerName, - const uno::Any& rNewOuterDefault ) : + uno::Any aNewOuterDefault ) : WrappedProperty( rOuterName, rInnerName ), - m_aOuterDefaultValue( rNewOuterDefault ) + m_aOuterDefaultValue(std::move( aNewOuterDefault )) {} WrappedDefaultProperty::~WrappedDefaultProperty() diff --git a/chart2/source/tools/WrappedProperty.cxx b/chart2/source/tools/WrappedProperty.cxx index ee28aba86e68..b055ef3ce586 100644 --- a/chart2/source/tools/WrappedProperty.cxx +++ b/chart2/source/tools/WrappedProperty.cxx @@ -20,6 +20,7 @@ #include <WrappedProperty.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> +#include <utility> #include <tools/diagnose_ex.h> using namespace ::com::sun::star; @@ -29,9 +30,9 @@ using ::com::sun::star::uno::Reference; namespace chart { -WrappedProperty::WrappedProperty( const OUString& rOuterName, const OUString& rInnerName) - : m_aOuterName( rOuterName ) - , m_aInnerName( rInnerName ) +WrappedProperty::WrappedProperty( OUString aOuterName, OUString aInnerName) + : m_aOuterName(std::move( aOuterName )) + , m_aInnerName(std::move( aInnerName )) { } WrappedProperty::~WrappedProperty() |