diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-14 09:10:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-15 07:48:14 +0100 |
commit | c2429e3e95a4298f43c468f36a1a2832992dd40e (patch) | |
tree | f43bd173eabe863b896de6057b5aee2f92d808d5 /sd/source/ui/view/sdview3.cxx | |
parent | b89f239aa9d3d4660380bbd0c893aecde0986032 (diff) |
loplugin:flatten in sd/source/ui/view
Change-Id: I28e75ec162cde89fe1aa7d85aecce7ce80878d88
Reviewed-on: https://gerrit.libreoffice.org/67828
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/view/sdview3.cxx')
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 3c96e5abd9a8..e392b69fa23f 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -117,32 +117,32 @@ static SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone>& aConnectorCo // restrict movement to WorkArea static void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle& rWorkArea) { - if(!rWorkArea.IsEmpty()) - { - ::tools::Rectangle aMarkRect(Point(rPos.X() - (rSize.Width() / 2), rPos.Y() - (rSize.Height() / 2)), rSize); + if(rWorkArea.IsEmpty()) + return; - if(!aMarkRect.IsInside(rWorkArea)) - { - if(aMarkRect.Left() < rWorkArea.Left()) - { - rPos.AdjustX(rWorkArea.Left() - aMarkRect.Left() ); - } + ::tools::Rectangle aMarkRect(Point(rPos.X() - (rSize.Width() / 2), rPos.Y() - (rSize.Height() / 2)), rSize); - if(aMarkRect.Right() > rWorkArea.Right()) - { - rPos.AdjustX( -(aMarkRect.Right() - rWorkArea.Right()) ); - } + if(aMarkRect.IsInside(rWorkArea)) + return; - if(aMarkRect.Top() < rWorkArea.Top()) - { - rPos.AdjustY(rWorkArea.Top() - aMarkRect.Top() ); - } + if(aMarkRect.Left() < rWorkArea.Left()) + { + rPos.AdjustX(rWorkArea.Left() - aMarkRect.Left() ); + } - if(aMarkRect.Bottom() > rWorkArea.Bottom()) - { - rPos.AdjustY( -(aMarkRect.Bottom() - rWorkArea.Bottom()) ); - } - } + if(aMarkRect.Right() > rWorkArea.Right()) + { + rPos.AdjustX( -(aMarkRect.Right() - rWorkArea.Right()) ); + } + + if(aMarkRect.Top() < rWorkArea.Top()) + { + rPos.AdjustY(rWorkArea.Top() - aMarkRect.Top() ); + } + + if(aMarkRect.Bottom() > rWorkArea.Bottom()) + { + rPos.AdjustY( -(aMarkRect.Bottom() - rWorkArea.Bottom()) ); } } |