From 44688e498c9672f0a1759ead394f6d6e0f0ef5fd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 23 Oct 2018 07:36:33 +0200 Subject: clang-tidy performance-unnecessary-copy-initialization in basctl..basic Change-Id: I4009282869cd8a2f269093564bd4fafccab80ec3 Reviewed-on: https://gerrit.libreoffice.org/62212 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 2 +- basegfx/source/polygon/b2dpolygontools.cxx | 2 +- basegfx/source/polygon/b2dpolygontriangulator.cxx | 4 ++-- basegfx/source/polygon/b2dpolypolygoncutter.cxx | 18 +++++++++--------- basegfx/source/polygon/b2dsvgpolypolygon.cxx | 2 +- basegfx/source/polygon/b3dpolypolygontools.cxx | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'basegfx/source') diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index f34c7bb3a4a2..d878a2801125 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -991,7 +991,7 @@ namespace basegfx for(sal_uInt32 m(0); m < nCountM; m++) { - const B2DPolygon aMask(rPolyMask.getB2DPolygon(m)); + const B2DPolygon& aMask(rPolyMask.getB2DPolygon(m)); const sal_uInt32 nCountB(aMask.count()); if(nCountB) diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 20b193d099bc..5c8eaa5792a6 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1451,7 +1451,7 @@ namespace basegfx bool isInEpsilonRange(const B2DPolygon& rCandidate, const B2DPoint& rTestPosition, double fDistance) { // force to non-bezier polygon - const B2DPolygon aCandidate(rCandidate.getDefaultAdaptiveSubdivision()); + const B2DPolygon& aCandidate(rCandidate.getDefaultAdaptiveSubdivision()); const sal_uInt32 nPointCount(aCandidate.count()); if(nPointCount) diff --git a/basegfx/source/polygon/b2dpolygontriangulator.cxx b/basegfx/source/polygon/b2dpolygontriangulator.cxx index a7041e2053fc..ed58d2f03d27 100644 --- a/basegfx/source/polygon/b2dpolygontriangulator.cxx +++ b/basegfx/source/polygon/b2dpolygontriangulator.cxx @@ -220,7 +220,7 @@ namespace basegfx { for(sal_uInt32 a(0); a < rCandidate.count(); a++) { - const B2DPolygon aPolygonCandidate(rCandidate.getB2DPolygon(a)); + const B2DPolygon& aPolygonCandidate(rCandidate.getB2DPolygon(a)); const sal_uInt32 nCount(aPolygonCandidate.count()); if(nCount > 2) @@ -419,7 +419,7 @@ namespace basegfx if(aCandidate.count() == 1) { // single polygon -> single polygon triangulation - const B2DPolygon aSinglePolygon(aCandidate.getB2DPolygon(0)); + const B2DPolygon& aSinglePolygon(aCandidate.getB2DPolygon(0)); aRetval = triangulate(aSinglePolygon); } diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 4fd7bf369d85..d80c670fe04f 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -535,7 +535,7 @@ namespace basegfx // count points for(a = 0; a < nOriginalCount; a++) { - const B2DPolygon aCandidate(aGeometry.getB2DPolygon(a)); + const B2DPolygon& aCandidate(aGeometry.getB2DPolygon(a)); const sal_uInt32 nCandCount(aCandidate.count()); // If it's not a bezier curve, at least three points would be needed to have a @@ -561,7 +561,7 @@ namespace basegfx for(a = 0; a < nOriginalCount; a++) { - const B2DPolygon aCandidate(aGeometry.getB2DPolygon(a)); + const B2DPolygon& aCandidate(aGeometry.getB2DPolygon(a)); const sal_uInt32 nCandCount(aCandidate.count()); // use same condition as above, the data vector is @@ -710,7 +710,7 @@ namespace basegfx for(sal_uInt32 a(0); a < rCandidate.count(); a++) { - const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); + const B2DPolygon& aCandidate(rCandidate.getB2DPolygon(a)); if(utils::getOrientation(aCandidate) != B2VectorOrientation::Neutral) { @@ -749,7 +749,7 @@ namespace basegfx for(a = 0; a < nCount; a++) { - const B2DPolygon aCand(aCandidate.getB2DPolygon(a)); + const B2DPolygon& aCand(aCandidate.getB2DPolygon(a)); StripHelper* pNewHelper = &(aHelpers[a]); pNewHelper->maRange = utils::getRange(aCand); pNewHelper->meOrinetation = utils::getOrientation(aCand); @@ -760,12 +760,12 @@ namespace basegfx for(a = 0; a < nCount - 1; a++) { - const B2DPolygon aCandA(aCandidate.getB2DPolygon(a)); + const B2DPolygon& aCandA(aCandidate.getB2DPolygon(a)); StripHelper& rHelperA = aHelpers[a]; for(b = a + 1; b < nCount; b++) { - const B2DPolygon aCandB(aCandidate.getB2DPolygon(b)); + const B2DPolygon& aCandB(aCandidate.getB2DPolygon(b)); StripHelper& rHelperB = aHelpers[b]; const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && utils::isInside(aCandB, aCandA, true)); @@ -829,7 +829,7 @@ namespace basegfx for(a = 0; a < nCount; a++) { - const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); + const B2DPolygon& aCandidate(rCandidate.getB2DPolygon(a)); StripHelper* pNewHelper = &(aHelpers[a]); pNewHelper->maRange = utils::getRange(aCandidate); pNewHelper->meOrinetation = utils::getOrientation(aCandidate); @@ -838,12 +838,12 @@ namespace basegfx for(a = 0; a < nCount - 1; a++) { - const B2DPolygon aCandA(rCandidate.getB2DPolygon(a)); + const B2DPolygon& aCandA(rCandidate.getB2DPolygon(a)); StripHelper& rHelperA = aHelpers[a]; for(b = a + 1; b < nCount; b++) { - const B2DPolygon aCandB(rCandidate.getB2DPolygon(b)); + const B2DPolygon& aCandB(rCandidate.getB2DPolygon(b)); StripHelper& rHelperB = aHelpers[b]; const bool bAInB(rHelperB.maRange.isInside(rHelperA.maRange) && utils::isInside(aCandB, aCandA, true)); const bool bBInA(rHelperA.maRange.isInside(rHelperB.maRange) && utils::isInside(aCandA, aCandB, true)); diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 2a195641d5f0..7906704e76e3 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -733,7 +733,7 @@ namespace basegfx for(sal_uInt32 i(0); i < nCount; i++) { - const B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(i)); + const B2DPolygon& aPolygon(rPolyPolygon.getB2DPolygon(i)); const sal_uInt32 nPointCount(aPolygon.count()); if(nPointCount) diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx index db0654df266b..abd7340d4b69 100644 --- a/basegfx/source/polygon/b3dpolypolygontools.cxx +++ b/basegfx/source/polygon/b3dpolypolygontools.cxx @@ -46,7 +46,7 @@ namespace basegfx for(sal_uInt32 a(0); a < nPolygonCount; a++) { - B3DPolygon aCandidate = rCandidate.getB3DPolygon(a); + const B3DPolygon& aCandidate = rCandidate.getB3DPolygon(a); aRetval.expand(getRange(aCandidate)); } @@ -470,7 +470,7 @@ namespace basegfx for(sal_uInt32 a(0); a < nPolygonCount; a++) { - const B3DPolygon aPolygon(rCandidate.getB3DPolygon(a)); + const B3DPolygon& aPolygon(rCandidate.getB3DPolygon(a)); const bool bInside(isInside(aPolygon, rPoint, false/*bWithBorder*/)); if(bInside) @@ -550,7 +550,7 @@ namespace basegfx for(sal_uInt32 a(0); a < nPolygonCount; a++) { - const basegfx::B3DPolygon aPoly(rPolyPolygonSource.getB3DPolygon(a)); + const basegfx::B3DPolygon& aPoly(rPolyPolygonSource.getB3DPolygon(a)); const sal_uInt32 nPointCount(aPoly.count()); if(nPointCount) -- cgit