diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-02 15:48:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-02 17:43:27 +0200 |
commit | 859e0acc39c5353bc8ec2bafcf62d030bfb2bacd (patch) | |
tree | 9eb0735529aeb2b4a4576a25c4f10760bad2aeb8 /cppcanvas | |
parent | b4163877e722298b42f6e96831bd8ffef7785a20 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'cppcanvas')
18 files changed, 59 insertions, 47 deletions
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; |