summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-10-14 22:09:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 07:56:00 +0200
commit40bc840da261fcc5652e5278dc2566b61f990884 (patch)
tree7d472b8f69bfa7bf6b8c67585d74b6dee4f5bcc4 /svx/source/sdr
parent2da25cb43f4af8d094b01de1073eee2e2023c029 (diff)
use range based loops over B2DPolyPolygon in svx
avoid copy when adapting polygon in SdrPathObj::ImpForceKind() Change-Id: Ifd830ecd181563102ee269c6a609ef8ebeab670c Reviewed-on: https://gerrit.libreoffice.org/61767 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dlathe.cxx6
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx4
2 files changed, 4 insertions, 6 deletions
diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
index d3bba8823edf..aee851a80bc6 100644
--- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
@@ -56,13 +56,11 @@ namespace sdr
// calculate texture size. Use the polygon length of the longest polygon for
// height and the rotated radius for width (using polygon center) to get a good
// texture mapping
- const sal_uInt32 nPolygonCount(aPolyPolygon.count());
double fPolygonMaxLength(0.0);
- for(sal_uInt32 a(0); a < nPolygonCount; a++)
+ for(auto const& rCandidate : aPolyPolygon)
{
- const basegfx::B2DPolygon aCandidate(aPolyPolygon.getB2DPolygon(a));
- const double fPolygonLength(basegfx::utils::getLength(aCandidate));
+ const double fPolygonLength(basegfx::utils::getLength(rCandidate));
fPolygonMaxLength = std::max(fPolygonMaxLength, fPolygonLength);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 9cf85e52d530..9005b67a3fb4 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -46,9 +46,9 @@ namespace sdr
sal_uInt32 nPolyCount(rUnitPolyPolygon.count());
sal_uInt32 nPointCount(0);
- for(sal_uInt32 a(0); a < nPolyCount; a++)
+ for(auto const& rPolygon : rUnitPolyPolygon)
{
- nPointCount += rUnitPolyPolygon.getB2DPolygon(a).count();
+ nPointCount += rPolygon.count();
}
if(!nPointCount)