summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-23 09:05:19 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-24 05:02:19 +0000
commit12643f416102c868309ba8d082ea91726045f0d1 (patch)
tree4c27604ac923004039d52dec50282ec6442b346c
parent5145f60cc9046369923fca9a336f2009c426e9eb (diff)
use range based loops
Change-Id: I8144aa147883120cfbeacddaff0bcec486f84be2 Reviewed-on: https://gerrit.libreoffice.org/33449 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/sdr/overlay/overlayobjectlist.cxx31
1 files changed, 6 insertions, 25 deletions
diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx
index ba72794a8193..27baa4853df6 100644
--- a/svx/source/sdr/overlay/overlayobjectlist.cxx
+++ b/svx/source/sdr/overlay/overlayobjectlist.cxx
@@ -24,8 +24,6 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <tools/gen.hxx>
-#include <algorithm>
-
#include <drawinglayer/processor2d/hittestprocessor2d.hxx>
#include <comphelper/lok.hxx>
@@ -43,20 +41,13 @@ namespace sdr
void OverlayObjectList::clear()
{
- OverlayObjectVector::iterator aStart(maVector.begin());
-
- for(; aStart != maVector.end(); ++aStart)
+ for(OverlayObject* pCandidate : maVector)
{
- sdr::overlay::OverlayObject* pCandidate = *aStart;
-
if(pCandidate->getOverlayManager())
- {
pCandidate->getOverlayManager()->remove(*pCandidate);
- }
delete pCandidate;
}
-
maVector.clear();
}
@@ -70,8 +61,7 @@ namespace sdr
{
if(!maVector.empty())
{
- OverlayObjectVector::const_iterator aStart(maVector.begin());
- sdr::overlay::OverlayObject* pFirst = *aStart;
+ OverlayObject* pFirst = maVector.front();
OverlayManager* pManager = pFirst->getOverlayManager();
if(pManager)
@@ -99,10 +89,8 @@ namespace sdr
fLogicTolerance,
false);
- for(; aStart != maVector.end(); ++aStart)
+ for(OverlayObject* pCandidate : maVector)
{
- sdr::overlay::OverlayObject* pCandidate = *aStart;
-
if(pCandidate->isHittable())
{
const drawinglayer::primitive2d::Primitive2DContainer& rSequence = pCandidate->getOverlayObjectPrimitive2DSequence();
@@ -129,8 +117,7 @@ namespace sdr
sal_uInt32 nDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL;
if(!maVector.empty())
{
- OverlayObjectVector::const_iterator aStart(maVector.begin());
- sdr::overlay::OverlayObject* pCandidate = *aStart;
+ OverlayObject* pCandidate = maVector.front();
OverlayManager* pManager = pCandidate->getOverlayManager();
if(pManager)
@@ -150,15 +137,9 @@ namespace sdr
{
basegfx::B2DRange aRetval;
- if(!maVector.empty())
+ for(OverlayObject* pCandidate : maVector)
{
- OverlayObjectVector::const_iterator aStart(maVector.begin());
-
- for(; aStart != maVector.end(); ++aStart)
- {
- sdr::overlay::OverlayObject* pCandidate = *aStart;
- aRetval.expand(pCandidate->getBaseRange());
- }
+ aRetval.expand(pCandidate->getBaseRange());
}
return aRetval;