cppcanvas/source/inc/canvasgraphichelper.hxx | 2 cppcanvas/source/inc/implrenderer.hxx | 5 cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx | 5 cppcanvas/source/mtfrenderer/cachedprimitivebase.hxx | 2 cppcanvas/source/mtfrenderer/implrenderer.cxx | 9 - cppcanvas/source/mtfrenderer/lineaction.cxx | 7 - cppcanvas/source/mtfrenderer/pointaction.cxx | 7 - cppcanvas/source/mtfrenderer/polypolyaction.cxx | 13 +- cppcanvas/source/mtfrenderer/textaction.cxx | 13 +- cppcanvas/source/mtfrenderer/textlineshelper.cxx | 5 cppcanvas/source/mtfrenderer/textlineshelper.hxx | 2 cppcanvas/source/tools/canvasgraphichelper.cxx | 5 cppcanvas/source/wrapper/implcanvas.cxx | 5 cppcanvas/source/wrapper/implcanvas.hxx | 2 cppcanvas/source/wrapper/implpolypolygon.cxx | 5 cppcanvas/source/wrapper/implpolypolygon.hxx | 4 cppcanvas/source/wrapper/implsprite.cxx | 9 - cppcanvas/source/wrapper/implsprite.hxx | 6 - cppuhelper/source/component_context.cxx | 5 cppuhelper/source/factory.cxx | 5 cppuhelper/source/propertysetmixin.cxx | 5 cppuhelper/source/servicemanager.cxx | 7 - cppuhelper/source/servicemanager.hxx | 29 ++--- cppuhelper/source/typemanager.cxx | 102 +++++++++---------- cppuhelper/source/unourl.cxx | 5 25 files changed, 139 insertions(+), 125 deletions(-)
New commits: commit d16122e3e93c2ab4b94d089c4cf4f8ea2dbdf24c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jun 2 15:55:10 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jun 2 17:43:43 2022 +0200 clang-tidy modernize-pass-by-value in cppuhelper Change-Id: I231b84cd973d730fe301045cb7442af2d1ddc5d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135311 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index 440fe18cfa4d..81c7d306fae3 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -44,6 +44,7 @@ #include <comphelper/sequence.hxx> #include <memory> +#include <utility> constexpr OUStringLiteral SMGR_SINGLETON = u"/singletons/com.sun.star.lang.theServiceManager"; constexpr OUStringLiteral TDMGR_SINGLETON = u"/singletons/com.sun.star.reflection.theTypeDescriptionManager"; @@ -127,8 +128,8 @@ protected: Any value; bool lateInit; - ContextEntry( Any const & value_, bool lateInit_ ) - : value( value_ ) + ContextEntry( Any value_, bool lateInit_ ) + : value(std::move( value_ )) , lateInit( lateInit_ ) {} }; diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index e6b920858160..c8efcab0e604 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <memory> +#include <utility> using namespace osl; @@ -66,14 +67,14 @@ class OSingleFactoryHelper public: OSingleFactoryHelper( const Reference<XMultiServiceFactory > & rServiceManager, - const OUString & rImplementationName_, + OUString aImplementationName_, ComponentInstantiation pCreateFunction_, ComponentFactoryFunc fptr, const Sequence< OUString > * pServiceNames_ ) : xSMgr( rServiceManager ) , pCreateFunction( pCreateFunction_ ) , m_fptr( fptr ) - , aImplementationName( rImplementationName_ ) + , aImplementationName(std::move( aImplementationName_ )) { if( pServiceNames_ ) aServiceNames = *pServiceNames_; diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx index 030160c65f0f..0d94e7a822a6 100644 --- a/cppuhelper/source/propertysetmixin.cxx +++ b/cppuhelper/source/propertysetmixin.cxx @@ -24,6 +24,7 @@ #include <map> #include <mutex> #include <set> +#include <utility> #include <vector> #include <com/sun/star/beans/Property.hpp> @@ -79,8 +80,8 @@ namespace { struct PropertyData { explicit PropertyData( - css::beans::Property const & theProperty, bool thePresent): - property(theProperty), present(thePresent) {} + css::beans::Property theProperty, bool thePresent): + property(std::move(theProperty)), present(thePresent) {} css::beans::Property property; bool present; diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 1a0e85780b21..5bcd2dfee76f 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -14,6 +14,7 @@ #include <iostream> #include <mutex> #include <string_view> +#include <utility> #include <vector> #include <com/sun/star/beans/NamedValue.hpp> @@ -106,7 +107,7 @@ class Parser { public: Parser( OUString const & uri, - css::uno::Reference< css::uno::XComponentContext > const & alienContext, + css::uno::Reference< css::uno::XComponentContext > alienContext, cppuhelper::ServiceManager::Data * data); Parser(const Parser&) = delete; @@ -136,9 +137,9 @@ private: Parser::Parser( OUString const & uri, - css::uno::Reference< css::uno::XComponentContext > const & alienContext, + css::uno::Reference< css::uno::XComponentContext > alienContext, cppuhelper::ServiceManager::Data * data): - reader_(uri), alienContext_(alienContext), data_(data) + reader_(uri), alienContext_(std::move(alienContext)), data_(data) { assert(data != nullptr); int ucNsId = reader_.registerNamespaceIri( diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx index b47d188ca82b..cdf23b277040 100644 --- a/cppuhelper/source/servicemanager.hxx +++ b/cppuhelper/source/servicemanager.hxx @@ -16,6 +16,7 @@ #include <memory> #include <mutex> #include <string_view> +#include <utility> #include <vector> #include <com/sun/star/beans/XPropertySet.hpp> @@ -71,32 +72,30 @@ public: struct Implementation { Implementation( - OUString const & theName, OUString const & theLoader, - OUString const & theUri, OUString const & theEnvironment, - OUString const & theConstructorName, - OUString const & thePrefix, + OUString theName, OUString theLoader, + OUString theUri, OUString theEnvironment, + OUString theConstructorName, + OUString thePrefix, bool theIsSingleInstance, - css::uno::Reference< css::uno::XComponentContext > const & - theAlienContext, - OUString const & theRdbFile): - name(theName), loader(theLoader), uri(theUri), environment(theEnvironment), - constructorName(theConstructorName), prefix(thePrefix), + css::uno::Reference< css::uno::XComponentContext > theAlienContext, + OUString theRdbFile): + name(std::move(theName)), loader(std::move(theLoader)), uri(std::move(theUri)), environment(std::move(theEnvironment)), + constructorName(std::move(theConstructorName)), prefix(std::move(thePrefix)), isSingleInstance(theIsSingleInstance), - alienContext(theAlienContext), rdbFile(theRdbFile), + alienContext(std::move(theAlienContext)), rdbFile(std::move(theRdbFile)), constructorFn(nullptr), status(STATUS_NEW), dispose(true) {} Implementation( - OUString const & theName, + OUString theName, css::uno::Reference< css::lang::XSingleComponentFactory > const & theFactory1, css::uno::Reference< css::lang::XSingleServiceFactory > const & theFactory2, - css::uno::Reference< css::lang::XComponent > const & - theComponent): - name(theName), isSingleInstance(false), constructorFn(nullptr), + css::uno::Reference< css::lang::XComponent > theComponent): + name(std::move(theName)), isSingleInstance(false), constructorFn(nullptr), factory1(theFactory1), factory2(theFactory2), - component(theComponent), status(STATUS_LOADED), dispose(true) + component(std::move(theComponent)), status(STATUS_LOADED), dispose(true) { assert(theFactory1.is() || theFactory2.is()); } Implementation(const Implementation&) = delete; diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx index ef6faef4b92a..39bec6b9cada 100644 --- a/cppuhelper/source/typemanager.cxx +++ b/cppuhelper/source/typemanager.cxx @@ -82,8 +82,8 @@ class SimpleTypeDescription: { public: SimpleTypeDescription( - css::uno::TypeClass typeClass, OUString const & name): - typeClass_(typeClass), name_(name) + css::uno::TypeClass typeClass, OUString name): + typeClass_(typeClass), name_(std::move(name)) {} private: @@ -105,8 +105,8 @@ class SequenceTypeDescription: public: SequenceTypeDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, OUString const & componentType): - manager_(manager), name_(name), componentType_(componentType) + OUString name, OUString componentType): + manager_(manager), name_(std::move(name)), componentType_(std::move(componentType)) { assert(manager.is()); } private: @@ -148,9 +148,9 @@ class ModuleDescription: public: ModuleDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::ModuleEntity > const & entity): - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -199,9 +199,9 @@ EnumTypeDescription_Base; class EnumTypeDescription: public EnumTypeDescription_Base { public: EnumTypeDescription( - OUString const & name, + OUString name, rtl::Reference< unoidl::EnumTypeEntity > const & entity): - EnumTypeDescription_Base(entity->isPublished()), name_(name), + EnumTypeDescription_Base(entity->isPublished()), name_(std::move(name)), entity_(entity) { assert(entity.is()); } @@ -257,10 +257,10 @@ class PlainStructTypeDescription: public PlainStructTypeDescription_Base { public: PlainStructTypeDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::PlainStructTypeEntity > const & entity): PlainStructTypeDescription_Base(entity->isPublished()), - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -333,8 +333,8 @@ class ParameterizedMemberTypeDescription: { public: explicit ParameterizedMemberTypeDescription( - OUString const & typeParameterName): - typeParameterName_(typeParameterName) + OUString typeParameterName): + typeParameterName_(std::move(typeParameterName)) {} private: @@ -359,11 +359,11 @@ class PolymorphicStructTypeTemplateDescription: public: PolymorphicStructTypeTemplateDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > const & entity): PolymorphicStructTypeTemplateDescription_Base(entity->isPublished()), - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -450,11 +450,11 @@ class InstantiatedPolymorphicStructTypeDescription: public: InstantiatedPolymorphicStructTypeDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > const & entity, std::vector< OUString >&& arguments): - manager_(manager), name_(name), entity_(entity), arguments_(std::move(arguments)) + manager_(manager), name_(std::move(name)), entity_(entity), arguments_(std::move(arguments)) { assert(manager.is()); assert(entity.is()); @@ -553,10 +553,10 @@ class ExceptionTypeDescription: public ExceptionTypeDescription_Base { public: ExceptionTypeDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::ExceptionTypeEntity > const & entity): ExceptionTypeDescription_Base(entity->isPublished()), manager_(manager), - name_(name), entity_(entity) + name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -619,10 +619,10 @@ class AttributeDescription: public: AttributeDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, - unoidl::InterfaceTypeEntity::Attribute const & attribute, + OUString name, + unoidl::InterfaceTypeEntity::Attribute attribute, sal_Int32 position): - manager_(manager), name_(name), attribute_(attribute), + manager_(manager), name_(std::move(name)), attribute_(std::move(attribute)), position_(position) { assert(manager.is()); } @@ -705,9 +705,9 @@ class MethodParameter: public: MethodParameter( rtl::Reference< cppuhelper::TypeManager > const & manager, - unoidl::InterfaceTypeEntity::Method::Parameter const & parameter, + unoidl::InterfaceTypeEntity::Method::Parameter parameter, sal_Int32 position): - manager_(manager), parameter_(parameter), position_(position) + manager_(manager), parameter_(std::move(parameter)), position_(position) { assert(manager.is()); } private: @@ -753,9 +753,9 @@ class MethodDescription: public: MethodDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, - unoidl::InterfaceTypeEntity::Method const & method, sal_Int32 position): - manager_(manager), name_(name), method_(method), position_(position) + OUString name, + unoidl::InterfaceTypeEntity::Method method, sal_Int32 position): + manager_(manager), name_(std::move(name)), method_(std::move(method)), position_(position) { assert(manager.is()); } private: @@ -887,10 +887,10 @@ class InterfaceTypeDescription: public InterfaceTypeDescription_Base { public: InterfaceTypeDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::InterfaceTypeEntity > const & entity): InterfaceTypeDescription_Base(entity->isPublished()), manager_(manager), - name_(name), entity_(entity) + name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -1062,9 +1062,9 @@ ConstantGroupDescription_Base; class ConstantGroupDescription: public ConstantGroupDescription_Base { public: ConstantGroupDescription( - OUString const & name, + OUString name, rtl::Reference< unoidl::ConstantGroupEntity > const & entity): - ConstantGroupDescription_Base(entity->isPublished()), name_(name), + ConstantGroupDescription_Base(entity->isPublished()), name_(std::move(name)), entity_(entity) { assert(entity.is()); } @@ -1108,10 +1108,10 @@ class TypedefDescription: public TypedefDescription_Base { public: TypedefDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::TypedefEntity > const & entity): TypedefDescription_Base(entity->isPublished()), manager_(manager), - name_(name), entity_(entity) + name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -1138,10 +1138,9 @@ class ConstructorParameter: public: ConstructorParameter( rtl::Reference< cppuhelper::TypeManager > const & manager, - unoidl::SingleInterfaceBasedServiceEntity::Constructor::Parameter - const & parameter, + unoidl::SingleInterfaceBasedServiceEntity::Constructor::Parameter parameter, sal_Int32 position): - manager_(manager), parameter_(parameter), position_(position) + manager_(manager), parameter_(std::move(parameter)), position_(position) { assert(manager.is()); } private: @@ -1179,9 +1178,8 @@ class ConstructorDescription: public: ConstructorDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - unoidl::SingleInterfaceBasedServiceEntity::Constructor const & - constructor): - manager_(manager), constructor_(constructor) + unoidl::SingleInterfaceBasedServiceEntity::Constructor constructor): + manager_(manager), constructor_(std::move(constructor)) { assert(manager.is()); } private: @@ -1247,11 +1245,11 @@ class SingleInterfaceBasedServiceDescription: public: SingleInterfaceBasedServiceDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > const & entity): SingleInterfaceBasedServiceDescription_Base(entity->isPublished()), - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -1351,8 +1349,8 @@ class PropertyDescription: public: PropertyDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - unoidl::AccumulationBasedServiceEntity::Property const & property): - manager_(manager), property_(property) + unoidl::AccumulationBasedServiceEntity::Property property): + manager_(manager), property_(std::move(property)) { assert(manager.is()); } private: @@ -1385,11 +1383,11 @@ class AccumulationBasedServiceDescription: public: AccumulationBasedServiceDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::AccumulationBasedServiceEntity > const & entity): AccumulationBasedServiceDescription_Base(entity->isPublished()), - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -1554,10 +1552,10 @@ class InterfaceBasedSingletonDescription: public: InterfaceBasedSingletonDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::InterfaceBasedSingletonEntity > const & entity): InterfaceBasedSingletonDescription_Base(entity->isPublished()), - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -1598,10 +1596,10 @@ class ServiceBasedSingletonDescription: public: ServiceBasedSingletonDescription( rtl::Reference< cppuhelper::TypeManager > const & manager, - OUString const & name, + OUString name, rtl::Reference< unoidl::ServiceBasedSingletonEntity > const & entity): ServiceBasedSingletonDescription_Base(entity->isPublished()), - manager_(manager), name_(name), entity_(entity) + manager_(manager), name_(std::move(name)), entity_(entity) { assert(manager.is()); assert(entity.is()); } private: @@ -1666,16 +1664,16 @@ private: struct Position { Position( - OUString const & thePrefix, + OUString thePrefix, rtl::Reference< unoidl::MapCursor > const & theCursor): - prefix(thePrefix), cursor(theCursor) + prefix(std::move(thePrefix)), cursor(theCursor) { assert(theCursor.is()); } Position( - OUString const & thePrefix, + OUString thePrefix, rtl::Reference< unoidl::ConstantGroupEntity > const & theConstantGroup): - prefix(thePrefix), constantGroup(theConstantGroup), + prefix(std::move(thePrefix)), constantGroup(theConstantGroup), constantGroupIndex(constantGroup->getMembers().begin()) { assert(theConstantGroup.is()); } diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx index 8ee7e593ad20..9656dd078ba1 100644 --- a/cppuhelper/source/unourl.cxx +++ b/cppuhelper/source/unourl.cxx @@ -31,6 +31,7 @@ #include <map> #include <memory> +#include <utility> using cppu::UnoUrl; using cppu::UnoUrlDescriptor; @@ -187,10 +188,10 @@ public: private: Impl(OUString const & rConnectionDescriptor, OUString const & rProtocolDescriptor, - OUString const & rObjectName): + OUString aObjectName): m_aConnection(rConnectionDescriptor), m_aProtocol(rProtocolDescriptor), - m_aObjectName(rObjectName) + m_aObjectName(std::move(aObjectName)) {} }; commit 859e0acc39c5353bc8ec2bafcf62d030bfb2bacd Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jun 2 15:48:18 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jun 2 17:43:27 2022 +0200 clang-tidy modernize-pass-by-value in cppcanvas Change-Id: I01e638c468f0941e042a839f73801a3ae3cb022a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cppcanvas/source/inc/canvasgraphichelper.hxx b/cppcanvas/source/inc/canvasgraphichelper.hxx index 0716199ddbeb..03f6b91b6f46 100644 --- a/cppcanvas/source/inc/canvasgraphichelper.hxx +++ b/cppcanvas/source/inc/canvasgraphichelper.hxx @@ -41,7 +41,7 @@ namespace cppcanvas::internal class CanvasGraphicHelper : public virtual CanvasGraphic { public: - CanvasGraphicHelper( const CanvasSharedPtr& rParentCanvas ); + CanvasGraphicHelper( CanvasSharedPtr xParentCanvas ); // CanvasGraphic implementation virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) override; diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index 4e39cea723dc..44a168ee9225 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -24,6 +24,7 @@ #include <sal/types.h> #include <o3tl/span.hxx> #include <tools/stream.hxx> +#include <utility> #include <vcl/metaactiontypes.hxx> #include <cppcanvas/renderer.hxx> #include <cppcanvas/canvas.hxx> @@ -137,9 +138,9 @@ namespace cppcanvas::internal // public, since some functors need it, too. struct MtfAction { - MtfAction( const std::shared_ptr<Action>& rAction, + MtfAction( std::shared_ptr<Action> xAction, sal_Int32 nOrigIndex ) : - mpAction( rAction ), + mpAction(std::move( xAction )), mnOrigIndex( nOrigIndex ) { } diff --git a/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx b/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx index 8001ae8733f5..e5664cabfc1d 100644 --- a/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx +++ b/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx @@ -26,14 +26,15 @@ #include "cachedprimitivebase.hxx" #include <sal/log.hxx> +#include <utility> using namespace ::com::sun::star; namespace cppcanvas::internal { - CachedPrimitiveBase::CachedPrimitiveBase( const CanvasSharedPtr& rCanvas, + CachedPrimitiveBase::CachedPrimitiveBase( CanvasSharedPtr xCanvas, bool bOnlyRedrawWithSameTransform ) : - mpCanvas( rCanvas ), + mpCanvas(std::move( xCanvas )), mbOnlyRedrawWithSameTransform( bOnlyRedrawWithSameTransform ) { // TODO(F2): also store last view transform, and refuse to diff --git a/cppcanvas/source/mtfrenderer/cachedprimitivebase.hxx b/cppcanvas/source/mtfrenderer/cachedprimitivebase.hxx index 2f32d887b515..48a31db5d294 100644 --- a/cppcanvas/source/mtfrenderer/cachedprimitivebase.hxx +++ b/cppcanvas/source/mtfrenderer/cachedprimitivebase.hxx @@ -57,7 +57,7 @@ namespace cppcanvas::internal same. Otherwise, repaints are always performed via the cached primitive. */ - CachedPrimitiveBase( const CanvasSharedPtr& rCanvas, + CachedPrimitiveBase( CanvasSharedPtr xCanvas, bool bOnlyRedrawWithSameTransform ); CachedPrimitiveBase(const CachedPrimitiveBase&) = delete; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 06f020681ff8..846194bcf141 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -19,6 +19,7 @@ #include <tools/diagnose_ex.h> #include <tools/debug.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <comphelper/propertysequence.hxx> #include <comphelper/propertyvalue.hxx> @@ -2607,8 +2608,8 @@ namespace cppcanvas::internal class ActionRenderer { public: - explicit ActionRenderer( const ::basegfx::B2DHomMatrix& rTransformation ) : - maTransformation( rTransformation ), + explicit ActionRenderer( ::basegfx::B2DHomMatrix aTransformation ) : + maTransformation(std::move( aTransformation )), mbRet( true ) { } @@ -2642,8 +2643,8 @@ namespace cppcanvas::internal class AreaQuery { public: - explicit AreaQuery( const ::basegfx::B2DHomMatrix& rTransformation ) : - maTransformation( rTransformation ) + explicit AreaQuery( ::basegfx::B2DHomMatrix aTransformation ) : + maTransformation(std::move( aTransformation )) { } diff --git a/cppcanvas/source/mtfrenderer/lineaction.cxx b/cppcanvas/source/mtfrenderer/lineaction.cxx index 9c8734fdf450..4bc55d929958 100644 --- a/cppcanvas/source/mtfrenderer/lineaction.cxx +++ b/cppcanvas/source/mtfrenderer/lineaction.cxx @@ -30,6 +30,7 @@ #include <sal/log.hxx> #include <cppcanvas/canvas.hxx> +#include <utility> #include "mtftools.hxx" @@ -45,7 +46,7 @@ namespace cppcanvas::internal public: LineAction( const ::basegfx::B2DPoint&, const ::basegfx::B2DPoint&, - const CanvasSharedPtr&, + CanvasSharedPtr, const OutDevState& ); LineAction(const LineAction&) = delete; @@ -70,11 +71,11 @@ namespace cppcanvas::internal LineAction::LineAction( const ::basegfx::B2DPoint& rStartPoint, const ::basegfx::B2DPoint& rEndPoint, - const CanvasSharedPtr& rCanvas, + CanvasSharedPtr xCanvas, const OutDevState& rState ) : maStartPoint( rStartPoint ), maEndPoint( rEndPoint ), - mpCanvas( rCanvas ) + mpCanvas(std::move( xCanvas )) { tools::initRenderState(maState,rState); maState.DeviceColor = rState.lineColor; diff --git a/cppcanvas/source/mtfrenderer/pointaction.cxx b/cppcanvas/source/mtfrenderer/pointaction.cxx index 72550db5480b..449f4b9b4249 100644 --- a/cppcanvas/source/mtfrenderer/pointaction.cxx +++ b/cppcanvas/source/mtfrenderer/pointaction.cxx @@ -22,6 +22,7 @@ #include <sal/types.h> #include <sal/log.hxx> +#include <utility> #include <vcl/canvastools.hxx> #include <basegfx/range/b2drange.hxx> @@ -45,7 +46,7 @@ namespace cppcanvas::internal { public: PointAction( const ::basegfx::B2DPoint&, - const CanvasSharedPtr&, + CanvasSharedPtr, const OutDevState& ); PointAction( const ::basegfx::B2DPoint&, const CanvasSharedPtr&, @@ -72,10 +73,10 @@ namespace cppcanvas::internal }; PointAction::PointAction( const ::basegfx::B2DPoint& rPoint, - const CanvasSharedPtr& rCanvas, + CanvasSharedPtr xCanvas, const OutDevState& rState ) : maPoint( rPoint ), - mpCanvas( rCanvas ) + mpCanvas(std::move( xCanvas )) { tools::initRenderState(maState,rState); maState.DeviceColor = rState.lineColor; diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx index e191e512ec61..14ae52d8b2cf 100644 --- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx +++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx @@ -33,6 +33,7 @@ #include "cachedprimitivebase.hxx" #include "polypolyaction.hxx" #include <outdevstate.hxx> +#include <utility> #include "mtftools.hxx" @@ -226,7 +227,7 @@ namespace cppcanvas::internal TexturedPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly, const CanvasSharedPtr& rCanvas, const OutDevState& rState, - const rendering::Texture& rTexture ); + rendering::Texture aTexture ); virtual bool renderSubset( const ::basegfx::B2DHomMatrix& rTransformation, const Subset& rSubset ) const override; @@ -254,12 +255,12 @@ namespace cppcanvas::internal TexturedPolyPolyAction::TexturedPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPolyPoly, const CanvasSharedPtr& rCanvas, const OutDevState& rState, - const rendering::Texture& rTexture ) : + rendering::Texture aTexture ) : CachedPrimitiveBase( rCanvas, true ), mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ), maBounds( ::basegfx::utils::getRange(rPolyPoly) ), mpCanvas( rCanvas ), - maTexture( rTexture ) + maTexture(std::move( aTexture )) { tools::initRenderState(maState,rState); } @@ -337,7 +338,7 @@ namespace cppcanvas::internal StrokedPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly, const CanvasSharedPtr& rCanvas, const OutDevState& rState, - const rendering::StrokeAttributes& rStrokeAttributes ); + rendering::StrokeAttributes aStrokeAttributes ); virtual bool renderSubset( const ::basegfx::B2DHomMatrix& rTransformation, const Subset& rSubset ) const override; @@ -363,12 +364,12 @@ namespace cppcanvas::internal StrokedPolyPolyAction::StrokedPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPolyPoly, const CanvasSharedPtr& rCanvas, const OutDevState& rState, - const rendering::StrokeAttributes& rStrokeAttributes ) : + rendering::StrokeAttributes aStrokeAttributes ) : CachedPrimitiveBase( rCanvas, false ), mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ), maBounds( ::basegfx::utils::getRange(rPolyPoly) ), mpCanvas( rCanvas ), - maStrokeAttributes( rStrokeAttributes ) + maStrokeAttributes(std::move( aStrokeAttributes )) { tools::initRenderState(maState,rState); maState.DeviceColor = rState.lineColor; diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 091dde1c456c..c5ba2f41eb63 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -33,6 +33,7 @@ #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <tools/gen.hxx> +#include <utility> #include <vcl/canvastools.hxx> #include <vcl/virdev.hxx> @@ -1575,7 +1576,7 @@ namespace cppcanvas::internal const ::basegfx::B2DSize& rShadowOffset, const ::Color& rShadowColor, const ::basegfx::B2DRectangle& rOutlineBounds, - const uno::Reference< rendering::XPolyPolygon2D >& rTextPoly, + uno::Reference< rendering::XPolyPolygon2D > xTextPoly, const uno::Sequence< double >& rOffsets, VirtualDevice const & rVDev, const CanvasSharedPtr& rCanvas, @@ -1586,7 +1587,7 @@ namespace cppcanvas::internal const ::basegfx::B2DSize& rShadowOffset, const ::Color& rShadowColor, const ::basegfx::B2DRectangle& rOutlineBounds, - const uno::Reference< rendering::XPolyPolygon2D >& rTextPoly, + uno::Reference< rendering::XPolyPolygon2D > xTextPoly, const uno::Sequence< double >& rOffsets, VirtualDevice const & rVDev, const CanvasSharedPtr& rCanvas, @@ -1653,12 +1654,12 @@ namespace cppcanvas::internal const ::basegfx::B2DSize& rShadowOffset, const ::Color& rShadowColor, const ::basegfx::B2DRectangle& rOutlineBounds, - const uno::Reference< rendering::XPolyPolygon2D >& rTextPoly, + uno::Reference< rendering::XPolyPolygon2D > xTextPoly, const uno::Sequence< double >& rOffsets, VirtualDevice const & rVDev, const CanvasSharedPtr& rCanvas, const OutDevState& rState ) : - mxTextPoly( rTextPoly ), + mxTextPoly(std::move( xTextPoly )), maOffsets( rOffsets ), mpCanvas( rCanvas ), mnOutlineWidth( calcOutlineWidth(rState,rVDev) ), @@ -1695,13 +1696,13 @@ namespace cppcanvas::internal const ::basegfx::B2DSize& rShadowOffset, const ::Color& rShadowColor, const ::basegfx::B2DRectangle& rOutlineBounds, - const uno::Reference< rendering::XPolyPolygon2D >& rTextPoly, + uno::Reference< rendering::XPolyPolygon2D > xTextPoly, const uno::Sequence< double >& rOffsets, VirtualDevice const & rVDev, const CanvasSharedPtr& rCanvas, const OutDevState& rState, const ::basegfx::B2DHomMatrix& rTextTransform ) : - mxTextPoly( rTextPoly ), + mxTextPoly(std::move( xTextPoly )), maOffsets( rOffsets ), mpCanvas( rCanvas ), mnOutlineWidth( calcOutlineWidth(rState,rVDev) ), diff --git a/cppcanvas/source/mtfrenderer/textlineshelper.cxx b/cppcanvas/source/mtfrenderer/textlineshelper.cxx index 6bdc172e30ac..1120f12273be 100644 --- a/cppcanvas/source/mtfrenderer/textlineshelper.cxx +++ b/cppcanvas/source/mtfrenderer/textlineshelper.cxx @@ -13,6 +13,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/utils/canvastools.hxx> #include <outdevstate.hxx> +#include <utility> #include "textlineshelper.hxx" #include "mtftools.hxx" @@ -30,8 +31,8 @@ void initLineStyleWaveline(sal_uInt32 nLineStyle, bool& bIsWaveline, bool& bIsBo namespace cppcanvas::internal { -TextLinesHelper::TextLinesHelper(const CanvasSharedPtr& rCanvas, const OutDevState& rState) - : mpCanvas(rCanvas) +TextLinesHelper::TextLinesHelper(CanvasSharedPtr xCanvas, const OutDevState& rState) + : mpCanvas(std::move(xCanvas)) , mbIsOverlineColorSet(rState.isTextOverlineColorSet) , maOverlineColor(rState.textOverlineColor) , mbIsUnderlineColorSet(rState.isTextLineColorSet) diff --git a/cppcanvas/source/mtfrenderer/textlineshelper.hxx b/cppcanvas/source/mtfrenderer/textlineshelper.hxx index 38105961ee05..f0a53ff7a07d 100644 --- a/cppcanvas/source/mtfrenderer/textlineshelper.hxx +++ b/cppcanvas/source/mtfrenderer/textlineshelper.hxx @@ -53,7 +53,7 @@ class TextLinesHelper bool mbUnderlineWavelineBold; public: - TextLinesHelper(const CanvasSharedPtr& rCanvas, const OutDevState& rState); + TextLinesHelper(CanvasSharedPtr xCanvas, const OutDevState& rState); ::basegfx::B2DSize const& getOverallSize() const { return maOverallSize; } diff --git a/cppcanvas/source/tools/canvasgraphichelper.cxx b/cppcanvas/source/tools/canvasgraphichelper.cxx index 632294834cce..2bb6d976b76e 100644 --- a/cppcanvas/source/tools/canvasgraphichelper.cxx +++ b/cppcanvas/source/tools/canvasgraphichelper.cxx @@ -25,6 +25,7 @@ #include <canvas/canvastools.hxx> #include <basegfx/utils/canvastools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <utility> using namespace ::com::sun::star; @@ -33,8 +34,8 @@ using namespace ::com::sun::star; namespace cppcanvas::internal { - CanvasGraphicHelper::CanvasGraphicHelper( const CanvasSharedPtr& rParentCanvas ) : - mpCanvas( rParentCanvas ) + CanvasGraphicHelper::CanvasGraphicHelper( CanvasSharedPtr xParentCanvas ) : + mpCanvas(std::move( xParentCanvas )) { OSL_ENSURE( mpCanvas && mpCanvas->getUNOCanvas().is(), "CanvasGraphicHelper::CanvasGraphicHelper: no valid canvas" ); diff --git a/cppcanvas/source/wrapper/implcanvas.cxx b/cppcanvas/source/wrapper/implcanvas.cxx index 2760311d5ef7..8a412e805b87 100644 --- a/cppcanvas/source/wrapper/implcanvas.cxx +++ b/cppcanvas/source/wrapper/implcanvas.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/rendering/XCanvas.hpp> #include <canvas/canvastools.hxx> +#include <utility> #include "implcanvas.hxx" @@ -34,8 +35,8 @@ using namespace ::com::sun::star; namespace cppcanvas::internal { - ImplCanvas::ImplCanvas( const uno::Reference< rendering::XCanvas >& xCanvas ) : - mxCanvas( xCanvas ) + ImplCanvas::ImplCanvas( uno::Reference< rendering::XCanvas > xCanvas ) : + mxCanvas(std::move( xCanvas )) { OSL_ENSURE( mxCanvas.is(), "Canvas::Canvas() invalid XCanvas" ); diff --git a/cppcanvas/source/wrapper/implcanvas.hxx b/cppcanvas/source/wrapper/implcanvas.hxx index d49116c92860..cc49c819eeef 100644 --- a/cppcanvas/source/wrapper/implcanvas.hxx +++ b/cppcanvas/source/wrapper/implcanvas.hxx @@ -47,7 +47,7 @@ namespace cppcanvas::internal class ImplCanvas : public virtual Canvas { public: - explicit ImplCanvas( const css::uno::Reference< css::rendering::XCanvas >& rCanvas ); + explicit ImplCanvas( css::uno::Reference< css::rendering::XCanvas > xCanvas ); virtual ~ImplCanvas() override; ImplCanvas(ImplCanvas const &) = default; diff --git a/cppcanvas/source/wrapper/implpolypolygon.cxx b/cppcanvas/source/wrapper/implpolypolygon.cxx index 182bf6b47f42..536bfa60a53b 100644 --- a/cppcanvas/source/wrapper/implpolypolygon.cxx +++ b/cppcanvas/source/wrapper/implpolypolygon.cxx @@ -27,6 +27,7 @@ #include "implpolypolygon.hxx" #include <tools.hxx> +#include <utility> using namespace ::com::sun::star; @@ -35,9 +36,9 @@ using namespace ::com::sun::star; namespace cppcanvas::internal { ImplPolyPolygon::ImplPolyPolygon( const CanvasSharedPtr& rParentCanvas, - const uno::Reference< rendering::XPolyPolygon2D >& rPolyPoly ) : + uno::Reference< rendering::XPolyPolygon2D > xPolyPoly ) : CanvasGraphicHelper( rParentCanvas ), - mxPolyPoly( rPolyPoly ), + mxPolyPoly(std::move( xPolyPoly )), maStrokeAttributes(1.0, 10.0, uno::Sequence< double >(), diff --git a/cppcanvas/source/wrapper/implpolypolygon.hxx b/cppcanvas/source/wrapper/implpolypolygon.hxx index 341531fba74f..a756b4400795 100644 --- a/cppcanvas/source/wrapper/implpolypolygon.hxx +++ b/cppcanvas/source/wrapper/implpolypolygon.hxx @@ -39,8 +39,8 @@ namespace cppcanvas::internal { public: ImplPolyPolygon( const CanvasSharedPtr& rParentCanvas, - const css::uno::Reference< - css::rendering::XPolyPolygon2D >& rPolyPoly ); + css::uno::Reference< + css::rendering::XPolyPolygon2D > xPolyPoly ); virtual ~ImplPolyPolygon() override; diff --git a/cppcanvas/source/wrapper/implsprite.cxx b/cppcanvas/source/wrapper/implsprite.cxx index c0450880d75d..66434f941271 100644 --- a/cppcanvas/source/wrapper/implsprite.cxx +++ b/cppcanvas/source/wrapper/implsprite.cxx @@ -21,6 +21,7 @@ #include <basegfx/utils/canvastools.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <canvas/canvastools.hxx> +#include <utility> #include "implsprite.hxx" @@ -31,10 +32,10 @@ namespace cppcanvas::internal { ImplSprite::ImplSprite( const uno::Reference< rendering::XSpriteCanvas >& rParentCanvas, - const uno::Reference< rendering::XSprite >& rSprite, - const ImplSpriteCanvas::TransformationArbiterSharedPtr& rTransformArbiter ) : - mxSprite( rSprite ), - mpTransformArbiter( rTransformArbiter ) + uno::Reference< rendering::XSprite > rSprite, + ImplSpriteCanvas::TransformationArbiterSharedPtr xTransformArbiter ) : + mxSprite(std::move( rSprite )), + mpTransformArbiter(std::move( xTransformArbiter )) { // Avoiding ternary operator in initializer list (Solaris // compiler bug, when function call and temporary is diff --git a/cppcanvas/source/wrapper/implsprite.hxx b/cppcanvas/source/wrapper/implsprite.hxx index 220dfb9489fc..d40fb0574a96 100644 --- a/cppcanvas/source/wrapper/implsprite.hxx +++ b/cppcanvas/source/wrapper/implsprite.hxx @@ -32,9 +32,9 @@ namespace cppcanvas::internal public: ImplSprite( const css::uno::Reference< css::rendering::XSpriteCanvas >& rParentCanvas, - const css::uno::Reference< - css::rendering::XSprite >& rSprite, - const ImplSpriteCanvas::TransformationArbiterSharedPtr& rTransformArbiter ); + css::uno::Reference< + css::rendering::XSprite > xSprite, + ImplSpriteCanvas::TransformationArbiterSharedPtr xTransformArbiter ); virtual ~ImplSprite() override; virtual void setAlpha( const double& rAlpha ) override;