diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-20 09:51:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-21 08:59:50 +0200 |
commit | 85f4938719180e1e344b28c073f909df6f972f96 (patch) | |
tree | 21aa235575692503cf2a2d40f0e63b7aad661b9f /svx/source/customshapes | |
parent | cf69bb4f503eb8b3966d5caf825e0c05264a369e (diff) |
clang-tidy modernize-pass-by-value in svx
Change-Id: Iedd87d321f4d161574df87629fdd6c7714ff31c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137248
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/customshapes')
3 files changed, 28 insertions, 26 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index f7aa223f4997..dfa8c2380616 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -41,6 +41,7 @@ #include <functional> #include <algorithm> #include <stack> +#include <utility> #include <math.h> using namespace EnhancedCustomShape; @@ -290,9 +291,9 @@ class UnaryFunctionExpression : public ExpressionNode std::shared_ptr<ExpressionNode> mpArg; public: - UnaryFunctionExpression( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rArg ) : + UnaryFunctionExpression( const ExpressionFunct eFunct, std::shared_ptr<ExpressionNode> aArg ) : meFunct( eFunct ), - mpArg( rArg ) + mpArg(std::move( aArg )) { } static double getValue( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rArg ) @@ -460,10 +461,10 @@ class BinaryFunctionExpression : public ExpressionNode public: - BinaryFunctionExpression( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rFirstArg, const std::shared_ptr<ExpressionNode>& rSecondArg ) : + BinaryFunctionExpression( const ExpressionFunct eFunct, std::shared_ptr<ExpressionNode> xFirstArg, std::shared_ptr<ExpressionNode> xSecondArg ) : meFunct( eFunct ), - mpFirstArg( rFirstArg ), - mpSecondArg( rSecondArg ) + mpFirstArg(std::move( xFirstArg )), + mpSecondArg(std::move( xSecondArg )) { } #if defined(__clang__) || (defined (__GNUC__) && __GNUC__ >= 8) @@ -686,12 +687,12 @@ class IfExpression : public ExpressionNode public: - IfExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, - const std::shared_ptr<ExpressionNode>& rSecondArg, - const std::shared_ptr<ExpressionNode>& rThirdArg ) : - mpFirstArg( rFirstArg ), - mpSecondArg( rSecondArg ), - mpThirdArg( rThirdArg ) + IfExpression( std::shared_ptr<ExpressionNode> xFirstArg, + std::shared_ptr<ExpressionNode> xSecondArg, + std::shared_ptr<ExpressionNode> xThirdArg ) : + mpFirstArg(std::move( xFirstArg )), + mpSecondArg(std::move(xSecondArg )), + mpThirdArg(std::move( xThirdArg )) { } virtual bool isConstant() const override @@ -756,8 +757,8 @@ class DoubleConstantFunctor ParserContextSharedPtr mxContext; public: - explicit DoubleConstantFunctor( const ParserContextSharedPtr& rContext ) : - mxContext( rContext ) + explicit DoubleConstantFunctor( ParserContextSharedPtr xContext ) : + mxContext(std::move( xContext )) { } void operator()( double n ) const @@ -773,9 +774,9 @@ class EnumFunctor public: - EnumFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) + EnumFunctor( const ExpressionFunct eFunct, ParserContextSharedPtr xContext ) : meFunct( eFunct ) - , mxContext( rContext ) + , mxContext(std::move( xContext )) { } void operator()( StringIteratorT rFirst, StringIteratorT rSecond ) const @@ -808,9 +809,9 @@ class UnaryFunctionFunctor public: - UnaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) : + UnaryFunctionFunctor( const ExpressionFunct eFunct, ParserContextSharedPtr xContext ) : meFunct( eFunct ), - mxContext( rContext ) + mxContext(std::move( xContext )) { } void operator()( StringIteratorT, StringIteratorT ) const @@ -845,9 +846,9 @@ class BinaryFunctionFunctor public: - BinaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) : + BinaryFunctionFunctor( const ExpressionFunct eFunct, ParserContextSharedPtr xContext ) : meFunct( eFunct ), - mxContext( rContext ) + mxContext(std::move( xContext )) { } @@ -882,8 +883,8 @@ class IfFunctor public: - explicit IfFunctor( const ParserContextSharedPtr& rContext ) : - mxContext( rContext ) + explicit IfFunctor( ParserContextSharedPtr xContext ) : + mxContext(std::move( xContext )) { } void operator()( StringIteratorT, StringIteratorT ) const @@ -972,8 +973,8 @@ public: @param rParserContext Contains context info for the parser */ - explicit ExpressionGrammar( const ParserContextSharedPtr& rParserContext ) : - mpParserContext( rParserContext ) + explicit ExpressionGrammar( ParserContextSharedPtr xParserContext ) : + mpParserContext(std::move( xParserContext )) { } diff --git a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx index 8dce09c1ca1b..53c5201a604f 100644 --- a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx @@ -20,11 +20,12 @@ #include "EnhancedCustomShapeHandle.hxx" #include <svx/EnhancedCustomShape2d.hxx> #include <svx/svdoashp.hxx> +#include <utility> -EnhancedCustomShapeHandle::EnhancedCustomShapeHandle( css::uno::Reference< css::drawing::XShape > const & xCustomShape, sal_uInt32 nIndex ) : +EnhancedCustomShapeHandle::EnhancedCustomShapeHandle( css::uno::Reference< css::drawing::XShape > xCustomShape, sal_uInt32 nIndex ) : mnIndex ( nIndex ), - mxCustomShape ( xCustomShape ) + mxCustomShape (std::move( xCustomShape )) { } diff --git a/svx/source/customshapes/EnhancedCustomShapeHandle.hxx b/svx/source/customshapes/EnhancedCustomShapeHandle.hxx index b56909420768..00f70d3609bc 100644 --- a/svx/source/customshapes/EnhancedCustomShapeHandle.hxx +++ b/svx/source/customshapes/EnhancedCustomShapeHandle.hxx @@ -37,7 +37,7 @@ class EnhancedCustomShapeHandle : public cppu::WeakImplHelper public: - EnhancedCustomShapeHandle( css::uno::Reference< css::drawing::XShape > const & xCustomShape, sal_uInt32 nIndex ); + EnhancedCustomShapeHandle( css::uno::Reference< css::drawing::XShape > xCustomShape, sal_uInt32 nIndex ); virtual ~EnhancedCustomShapeHandle() override; // XInterface |