diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 12:47:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 14:20:06 +0200 |
commit | bfc298d02ca6275588d5897d97ced9498a3e91aa (patch) | |
tree | 45f290e8a753a2e382b940ed7f3c43b2bac959cd /svx/source/svdraw/svdsnpv.cxx | |
parent | ee9cb297c583cb5a2e6ed388af31fffc79f282ca (diff) |
loplugin:flatten in svx/svdraw
Change-Id: I8379e5ebaee2090d2b4dbd05d55b55000915cd7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100233
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdsnpv.cxx')
-rw-r--r-- | svx/source/svdraw/svdsnpv.cxx | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index 1fd9ac204fbe..2bb9527b63b4 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -72,23 +72,23 @@ ImplPageOriginOverlay::ImplPageOriginOverlay(const SdrPaintView& rView, const ba void ImplPageOriginOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition) { - if(rNewPosition != maPosition) + if(rNewPosition == maPosition) + return; + + // apply to OverlayObjects + for(sal_uInt32 a(0); a < maObjects.count(); a++) { - // apply to OverlayObjects - for(sal_uInt32 a(0); a < maObjects.count(); a++) - { - sdr::overlay::OverlayCrosshairStriped* pCandidate = - static_cast< sdr::overlay::OverlayCrosshairStriped* >(&maObjects.getOverlayObject(a)); + sdr::overlay::OverlayCrosshairStriped* pCandidate = + static_cast< sdr::overlay::OverlayCrosshairStriped* >(&maObjects.getOverlayObject(a)); - if(pCandidate) - { - pCandidate->setBasePosition(rNewPosition); - } + if(pCandidate) + { + pCandidate->setBasePosition(rNewPosition); } - - // remember new position - maPosition = rNewPosition; } + + // remember new position + maPosition = rNewPosition; } @@ -146,23 +146,23 @@ ImplHelpLineOverlay::ImplHelpLineOverlay( void ImplHelpLineOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition) { - if(rNewPosition != maPosition) + if(rNewPosition == maPosition) + return; + + // apply to OverlayObjects + for(sal_uInt32 a(0); a < maObjects.count(); a++) { - // apply to OverlayObjects - for(sal_uInt32 a(0); a < maObjects.count(); a++) - { - sdr::overlay::OverlayHelplineStriped* pCandidate = - static_cast< sdr::overlay::OverlayHelplineStriped* >(&maObjects.getOverlayObject(a)); + sdr::overlay::OverlayHelplineStriped* pCandidate = + static_cast< sdr::overlay::OverlayHelplineStriped* >(&maObjects.getOverlayObject(a)); - if(pCandidate) - { - pCandidate->setBasePosition(rNewPosition); - } + if(pCandidate) + { + pCandidate->setBasePosition(rNewPosition); } - - // remember new position - maPosition = rNewPosition; } + + // remember new position + maPosition = rNewPosition; } SdrSnapView::SdrSnapView( @@ -460,19 +460,19 @@ void SdrSnapView::MovSetPageOrg(const Point& rPnt) void SdrSnapView::EndSetPageOrg() { - if(IsSetPageOrg()) - { - SdrPageView* pPV = GetSdrPageView(); + if(!IsSetPageOrg()) + return; - if(pPV) - { - Point aPnt(maDragStat.GetNow()); - pPV->SetPageOrigin(aPnt); - } + SdrPageView* pPV = GetSdrPageView(); - // cleanup - BrkSetPageOrg(); + if(pPV) + { + Point aPnt(maDragStat.GetNow()); + pPV->SetPageOrigin(aPnt); } + + // cleanup + BrkSetPageOrg(); } void SdrSnapView::BrkSetPageOrg() |