diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-05 18:46:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-06 07:13:56 +0200 |
commit | cf739db1d6261c43b5b28c6795a4b5b30156478f (patch) | |
tree | c098d6e16440a7f938d145d324421ec6c3e10d0d /drawinglayer/source | |
parent | 547d8dacffc87586597d43e0e0378b4bb86b67a8 (diff) |
loplugin:moveparam in drawinglayer
Change-Id: I428116d96a011b061dda8376b6f27fb135a62964
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123114
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source')
17 files changed, 56 insertions, 57 deletions
diff --git a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx index ddf15708ca16..b07fa88c7ce3 100644 --- a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx +++ b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx @@ -35,9 +35,9 @@ namespace drawinglayer::attribute ImpSdrLightingAttribute( const basegfx::BColor& rAmbientLight, - const std::vector< Sdr3DLightAttribute >& rLightVector) + std::vector< Sdr3DLightAttribute >&& rLightVector) : maAmbientLight(rAmbientLight), - maLightVector(rLightVector) + maLightVector(std::move(rLightVector)) { } @@ -64,9 +64,9 @@ namespace drawinglayer::attribute SdrLightingAttribute::SdrLightingAttribute( const basegfx::BColor& rAmbientLight, - const std::vector< Sdr3DLightAttribute >& rLightVector) + std::vector< Sdr3DLightAttribute >&& rLightVector) : mpSdrLightingAttribute(ImpSdrLightingAttribute( - rAmbientLight, rLightVector)) + rAmbientLight, std::move(rLightVector))) { } diff --git a/drawinglayer/source/attribute/sdrlineattribute.cxx b/drawinglayer/source/attribute/sdrlineattribute.cxx index 217ed813cdcd..8224314058fa 100644 --- a/drawinglayer/source/attribute/sdrlineattribute.cxx +++ b/drawinglayer/source/attribute/sdrlineattribute.cxx @@ -42,13 +42,13 @@ namespace drawinglayer::attribute double fTransparence, const basegfx::BColor& rColor, css::drawing::LineCap eCap, - const std::vector< double >& rDotDashArray, + std::vector< double >&& rDotDashArray, double fFullDotDashLen) : mfWidth(fWidth), mfTransparence(fTransparence), mfFullDotDashLen(fFullDotDashLen), maColor(rColor), - maDotDashArray(rDotDashArray), + maDotDashArray(std::move(rDotDashArray)), meJoin(eJoin), meCap(eCap) { @@ -95,7 +95,7 @@ namespace drawinglayer::attribute double fTransparence, const basegfx::BColor& rColor, css::drawing::LineCap eCap, - const std::vector< double >& rDotDashArray, + std::vector< double >&& rDotDashArray, double fFullDotDashLen) : mpSdrLineAttribute( ImpSdrLineAttribute( @@ -104,7 +104,7 @@ namespace drawinglayer::attribute fTransparence, rColor, eCap, - rDotDashArray, + std::move(rDotDashArray), fFullDotDashLen)) { diff --git a/drawinglayer/source/attribute/strokeattribute.cxx b/drawinglayer/source/attribute/strokeattribute.cxx index d55aa2f35d75..b04a023aa7ac 100644 --- a/drawinglayer/source/attribute/strokeattribute.cxx +++ b/drawinglayer/source/attribute/strokeattribute.cxx @@ -32,9 +32,9 @@ namespace drawinglayer::attribute double mfFullDotDashLen; // sum of maDotDashArray (for convenience) ImpStrokeAttribute( - const std::vector< double >& rDotDashArray, + std::vector< double >&& rDotDashArray, double fFullDotDashLen) - : maDotDashArray(rDotDashArray), + : maDotDashArray(std::move(rDotDashArray)), mfFullDotDashLen(fFullDotDashLen) { } @@ -72,10 +72,10 @@ namespace drawinglayer::attribute } StrokeAttribute::StrokeAttribute( - const std::vector< double >& rDotDashArray, + std::vector< double >&& rDotDashArray, double fFullDotDashLen) : mpStrokeAttribute(ImpStrokeAttribute( - rDotDashArray, fFullDotDashLen)) + std::move(rDotDashArray), fFullDotDashLen)) { } diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 71657876bcfd..f26f690fb337 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -265,11 +265,11 @@ namespace drawinglayer::primitive2d BorderLinePrimitive2D::BorderLinePrimitive2D( const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd, - const std::vector< BorderLine >& rBorderLines, + std::vector< BorderLine >&& rBorderLines, const drawinglayer::attribute::StrokeAttribute& rStrokeAttribute) : maStart(rStart), maEnd(rEnd), - maBorderLines(rBorderLines), + maBorderLines(std::move(rBorderLines)), maStrokeAttribute(rStrokeAttribute) { } @@ -421,7 +421,7 @@ namespace drawinglayer::primitive2d new BorderLinePrimitive2D( pCandidateA->getStart(), pCandidateB->getEnd(), - aMergedBorderLines, + std::move(aMergedBorderLines), pCandidateA->getStrokeAttribute())); } diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx index c7929a89c7cf..515263e0d475 100644 --- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx @@ -230,7 +230,7 @@ namespace drawinglayer::primitive2d // add PointArrayPrimitive2D if point markers were added if(nCountPoint) { - rContainer.push_back(new PointArrayPrimitive2D(aPositionsPoint, getBColor())); + rContainer.push_back(new PointArrayPrimitive2D(std::move(aPositionsPoint), getBColor())); } // add MarkerArrayPrimitive2D if cross markers were added @@ -241,11 +241,11 @@ namespace drawinglayer::primitive2d { // no subdivisions, so fall back to points at grid positions, no need to // visualize a difference between divisions and sub-divisions - rContainer.push_back(new PointArrayPrimitive2D(aPositionsCross, getBColor())); + rContainer.push_back(new PointArrayPrimitive2D(std::move(aPositionsCross), getBColor())); } else { - rContainer.push_back(new MarkerArrayPrimitive2D(aPositionsCross, getCrossMarker())); + rContainer.push_back(new MarkerArrayPrimitive2D(std::move(aPositionsCross), getCrossMarker())); } } diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx index be7080769aea..ab66cb223a66 100644 --- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx @@ -70,9 +70,9 @@ namespace drawinglayer::primitive2d } MarkerArrayPrimitive2D::MarkerArrayPrimitive2D( - const std::vector< basegfx::B2DPoint >& rPositions, + std::vector< basegfx::B2DPoint >&& rPositions, const BitmapEx& rMarker) - : maPositions(rPositions), + : maPositions(std::move(rPositions)), maMarker(rMarker) { } diff --git a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx index 7c69ab687675..6299e185083c 100644 --- a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx @@ -27,9 +27,9 @@ using namespace com::sun::star; namespace drawinglayer::primitive2d { PointArrayPrimitive2D::PointArrayPrimitive2D( - const std::vector< basegfx::B2DPoint >& rPositions, + std::vector< basegfx::B2DPoint >&& rPositions, const basegfx::BColor& rRGBColor) - : maPositions(rPositions), + : maPositions(std::move(rPositions)), maRGBColor(rRGBColor) { } diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx index f723979e74be..503d07688ecd 100644 --- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx @@ -343,13 +343,13 @@ namespace drawinglayer::primitive2d SvgGradientHelper::SvgGradientHelper( const basegfx::B2DHomMatrix& rGradientTransform, const basegfx::B2DPolyPolygon& rPolyPolygon, - const SvgGradientEntryVector& rGradientEntries, + SvgGradientEntryVector&& rGradientEntries, const basegfx::B2DPoint& rStart, bool bUseUnitCoordinates, SpreadMethod aSpreadMethod) : maGradientTransform(rGradientTransform), maPolyPolygon(rPolyPolygon), - maGradientEntries(rGradientEntries), + maGradientEntries(std::move(rGradientEntries)), maStart(rStart), maSpreadMethod(aSpreadMethod), mbPreconditionsChecked(false), @@ -561,12 +561,12 @@ namespace drawinglayer::primitive2d SvgLinearGradientPrimitive2D::SvgLinearGradientPrimitive2D( const basegfx::B2DHomMatrix& rGradientTransform, const basegfx::B2DPolyPolygon& rPolyPolygon, - const SvgGradientEntryVector& rGradientEntries, + SvgGradientEntryVector&& rGradientEntries, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd, bool bUseUnitCoordinates, SpreadMethod aSpreadMethod) - : SvgGradientHelper(rGradientTransform, rPolyPolygon, rGradientEntries, rStart, bUseUnitCoordinates, aSpreadMethod), + : SvgGradientHelper(rGradientTransform, rPolyPolygon, std::move(rGradientEntries), rStart, bUseUnitCoordinates, aSpreadMethod), maEnd(rEnd) { } @@ -787,13 +787,13 @@ namespace drawinglayer::primitive2d SvgRadialGradientPrimitive2D::SvgRadialGradientPrimitive2D( const basegfx::B2DHomMatrix& rGradientTransform, const basegfx::B2DPolyPolygon& rPolyPolygon, - const SvgGradientEntryVector& rGradientEntries, + SvgGradientEntryVector&& rGradientEntries, const basegfx::B2DPoint& rStart, double fRadius, bool bUseUnitCoordinates, SpreadMethod aSpreadMethod, const basegfx::B2DPoint* pFocal) - : SvgGradientHelper(rGradientTransform, rPolyPolygon, rGradientEntries, rStart, bUseUnitCoordinates, aSpreadMethod), + : SvgGradientHelper(rGradientTransform, rPolyPolygon, std::move(rGradientEntries), rStart, bUseUnitCoordinates, aSpreadMethod), mfRadius(fRadius), maFocal(rStart), maFocalVector(0.0, 0.0), diff --git a/drawinglayer/source/primitive2d/textbreakuphelper.cxx b/drawinglayer/source/primitive2d/textbreakuphelper.cxx index 3b53d18a6e8a..9c4424b8d01e 100644 --- a/drawinglayer/source/primitive2d/textbreakuphelper.cxx +++ b/drawinglayer/source/primitive2d/textbreakuphelper.cxx @@ -136,7 +136,7 @@ namespace drawinglayer::primitive2d mrSource.getText(), nIndex, nLength, - aNewDXArray, + std::move(aNewDXArray), mrSource.getFontAttribute(), mrSource.getLocale(), mrSource.getFontColor(), @@ -167,7 +167,7 @@ namespace drawinglayer::primitive2d mrSource.getText(), nIndex, nLength, - aNewDXArray, + std::move(aNewDXArray), mrSource.getFontAttribute(), mrSource.getLocale(), mrSource.getFontColor())); diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx index 7c11edfc14dc..10cf07b4a8c0 100644 --- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx @@ -45,7 +45,7 @@ namespace drawinglayer::primitive2d rText, nTextPosition, nTextLength, - rDXArray, + std::vector(rDXArray), rFontAttribute, getLocale(), getFontColor()))); @@ -307,7 +307,7 @@ namespace drawinglayer::primitive2d const OUString& rText, sal_Int32 nTextPosition, sal_Int32 nTextLength, - const std::vector< double >& rDXArray, + std::vector< double >&& rDXArray, const attribute::FontAttribute& rFontAttribute, const css::lang::Locale& rLocale, const basegfx::BColor& rFontColor, @@ -326,7 +326,7 @@ namespace drawinglayer::primitive2d bool bEmphasisMarkBelow, TextRelief eTextRelief, bool bShadow) - : TextSimplePortionPrimitive2D(rNewTransform, rText, nTextPosition, nTextLength, rDXArray, rFontAttribute, rLocale, rFontColor, false, 0, rFillColor), + : TextSimplePortionPrimitive2D(rNewTransform, rText, nTextPosition, nTextLength, std::move(rDXArray), rFontAttribute, rLocale, rFontColor, false, 0, rFillColor), maOverlineColor(rOverlineColor), maTextlineColor(rTextlineColor), meFontOverline(eFontOverline), diff --git a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx index f791d9e63598..ea23ad25b684 100644 --- a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx @@ -177,7 +177,7 @@ namespace drawinglayer::primitive2d aDoubleArray.push_back(static_cast<double>(*p) * fHeight); } - aStrokeAttribute = attribute::StrokeAttribute(aDoubleArray); + aStrokeAttribute = attribute::StrokeAttribute(std::move(aDoubleArray)); } // create base polygon and new primitive diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index 15b0868ee3fb..b86e7acc20e7 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -200,7 +200,7 @@ void TextSimplePortionPrimitive2D::create2DDecomposition( TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D( const basegfx::B2DHomMatrix& rNewTransform, const OUString& rText, sal_Int32 nTextPosition, - sal_Int32 nTextLength, const std::vector<double>& rDXArray, + sal_Int32 nTextLength, std::vector<double>&& rDXArray, const attribute::FontAttribute& rFontAttribute, const css::lang::Locale& rLocale, const basegfx::BColor& rFontColor, bool bFilled, tools::Long nWidthToFill, const Color& rTextFillColor) @@ -208,7 +208,7 @@ TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D( , maText(rText) , mnTextPosition(nTextPosition) , mnTextLength(nTextLength) - , maDXArray(rDXArray) + , maDXArray(std::move(rDXArray)) , maFontAttribute(rFontAttribute) , maLocale(rLocale) , maFontColor(rFontColor) diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx index afcb3f1abeae..1c4983a87c18 100644 --- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx @@ -94,7 +94,7 @@ namespace drawinglayer::primitive2d aStrikeoutString.makeStringAndClear(), 0, len, - aDXArray, + std::move(aDXArray), getFontAttribute(), getLocale(), getFontColor())); diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx index e8d197e1a1e9..ec6bfaf3c8a4 100644 --- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx @@ -137,7 +137,7 @@ namespace drawinglayer::primitive3d // create line and stroke attribute const attribute::LineAttribute aLineAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getCap()); - const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen()); + const attribute::StrokeAttribute aStrokeAttribute(std::vector(rLine.getDotDashArray()), rLine.getFullDotDashLen()); // create primitives Primitive3DContainer aRetval(aScaledPolyPolygon.count()); diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index c850ff32e900..7ea03c9afd0c 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -495,7 +495,7 @@ std::unique_ptr<SvtGraphicStroke> VclMetafileProcessor2D::impTryToCreateSvtGraph pRetval.reset( new SvtGraphicStroke(tools::Polygon(aLocalPolygon), tools::PolyPolygon(aStartArrow), tools::PolyPolygon(aEndArrow), mfCurrentUnifiedTransparence, - fLineWidth, eCap, eJoin, fMiterLength, aDashArray)); + fLineWidth, eCap, eJoin, fMiterLength, std::move(aDashArray))); } return pRetval; diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index 6dc0d0020fa3..d2d082424493 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -546,16 +546,16 @@ namespace emfplushelper case EmfPlusLineStyleSolid: // do nothing special, use default stroke attribute break; case EmfPlusLineStyleDash: - aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(dash); + aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(std::vector(dash)); break; case EmfPlusLineStyleDot: - aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(dot); + aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(std::vector(dot)); break; case EmfPlusLineStyleDashDot: - aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(dashdot); + aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(std::vector(dashdot)); break; case EmfPlusLineStyleDashDotDot: - aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(dashdotdot); + aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(std::vector(dashdotdot)); break; } } @@ -568,7 +568,7 @@ namespace emfplushelper // convert from float to double and multiply with the adjusted pen width aPattern[i] = maMapTransform.get(1, 1) * pen->penWidth * pen->dashPattern[i]; } - aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(aPattern); + aStrokeAttribute = drawinglayer::attribute::StrokeAttribute(std::move(aPattern)); } if (!pen->GetColor().IsTransparent()) @@ -923,7 +923,7 @@ namespace emfplushelper new drawinglayer::primitive2d::SvgLinearGradientPrimitive2D( aTextureTransformation, polygon, - aVector, + std::move(aVector), aStartPoint, aEndPoint, false, // do not use UnitCoordinates @@ -939,7 +939,7 @@ namespace emfplushelper new drawinglayer::primitive2d::SvgRadialGradientPrimitive2D( aTextureTransformation, polygon, - aVector, + std::move(aVector), aCenterPoint, 0.5, // relative radius true, // use UnitCoordinates to stretch the gradient @@ -1689,7 +1689,7 @@ namespace emfplushelper text, 0, // text always starts at 0 stringLength, - emptyVector, // EMF-PLUS has no DX-array + std::move(emptyVector), // EMF-PLUS has no DX-array fontAttribute, locale, color.getBColor(), // Font Color @@ -1708,7 +1708,7 @@ namespace emfplushelper text, 0, // text always starts at 0 stringLength, - emptyVector, // EMF-PLUS has no DX-array + std::move(emptyVector), // EMF-PLUS has no DX-array fontAttribute, locale, color.getBColor()); @@ -2133,7 +2133,6 @@ namespace emfplushelper false); // BiDiStrong const Color color = EMFPGetBrushColorOrARGBColor(flags, brushIndexOrColor); - std::vector<double> aDXArray; // dummy for DX array (not used) // generate TextSimplePortionPrimitive2Ds or TextDecoratedPortionPrimitive2D // for all portions of text with the same charsPosY values @@ -2146,7 +2145,7 @@ namespace emfplushelper aLength++; // generate the DX-Array - aDXArray.clear(); + std::vector<double> aDXArray; for (size_t i = 0; i < aLength - 1; i++) { aDXArray.push_back(charsPosX[pos + i + 1] - charsPosX[pos]); @@ -2169,7 +2168,7 @@ namespace emfplushelper text, pos, // take character at current pos aLength, // use determined length - aDXArray, // generated DXArray + std::move(aDXArray), // generated DXArray fontAttribute, Application::GetSettings().GetLanguageTag().getLocale(), color.getBColor(), @@ -2188,7 +2187,7 @@ namespace emfplushelper text, pos, // take character at current pos aLength, // use determined length - aDXArray, // generated DXArray + std::move(aDXArray), // generated DXArray fontAttribute, Application::GetSettings().GetLanguageTag().getLocale(), color.getBColor()); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index f7c01f3330c1..0bfe1276eb26 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -447,7 +447,7 @@ namespace wmfemfhelper { rTarget.append( new drawinglayer::primitive2d::PointArrayPrimitive2D( - rPositions, + std::vector(rPositions), rBColor)); } else @@ -461,7 +461,7 @@ namespace wmfemfhelper rTarget.append( new drawinglayer::primitive2d::PointArrayPrimitive2D( - aPositions, + std::move(aPositions), rBColor)); } } @@ -544,7 +544,7 @@ namespace wmfemfhelper const double fAccumulated(std::accumulate(fDotDashArray.begin(), fDotDashArray.end(), 0.0)); const drawinglayer::attribute::StrokeAttribute aStrokeAttribute( - fDotDashArray, + std::move(fDotDashArray), fAccumulated); rTarget.append( @@ -1184,7 +1184,7 @@ namespace wmfemfhelper rText, nTextStart, nTextLength, - rDXArray, + std::vector(rDXArray), aFontAttribute, aLocale, aFontColor, @@ -1212,7 +1212,7 @@ namespace wmfemfhelper rText, nTextStart, nTextLength, - rDXArray, + std::vector(rDXArray), aFontAttribute, aLocale, aFontColor); |