summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/sdview3.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 08:43:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 13:23:40 +0100
commit4beed2ba7335fdb211aca7f70a144ffecf90a781 (patch)
tree23b645a3a2dca69466eaa664a34556d110745c95 /sd/source/ui/view/sdview3.cxx
parent79afa1d9b3ac33b75512095c6383db7f47342f26 (diff)
Revert "loplugin:changetoolsgen in sd" and reapply the plugin...
because I (a) forgot to insert parentheses which changes the meaning of some expressions and (b) I now use the AdjustFoo calls when changing unary operations, which reads much better This reverts commit 0d9f3f7628f88fa66aaeea1f7148db620e17e728. Change-Id: I33f79bf755aedc1ed48d95f7b82f3fabed1347fb Reviewed-on: https://gerrit.libreoffice.org/49834 Tested-by: Jenkins <ci@libreoffice.org> 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.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 3297d81d01db..c0f5f5e19413 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -124,22 +124,22 @@ void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle&
{
if(aMarkRect.Left() < rWorkArea.Left())
{
- rPos.setX( rPos.X() + rWorkArea.Left() - aMarkRect.Left() );
+ rPos.AdjustX(rWorkArea.Left() - aMarkRect.Left() );
}
if(aMarkRect.Right() > rWorkArea.Right())
{
- rPos.setX( rPos.X() - aMarkRect.Right() - rWorkArea.Right() );
+ rPos.AdjustX( -(aMarkRect.Right() - rWorkArea.Right()) );
}
if(aMarkRect.Top() < rWorkArea.Top())
{
- rPos.setY( rPos.Y() + rWorkArea.Top() - aMarkRect.Top() );
+ rPos.AdjustY(rWorkArea.Top() - aMarkRect.Top() );
}
if(aMarkRect.Bottom() > rWorkArea.Bottom())
{
- rPos.setY( rPos.Y() - aMarkRect.Bottom() - rWorkArea.Bottom() );
+ rPos.AdjustY( -(aMarkRect.Bottom() - rWorkArea.Bottom()) );
}
}
}
@@ -545,8 +545,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
{
const SdrGluePoint& rGluePoint = (*pGlueList)[nInd];
Point aPosition = rGluePoint.GetAbsolutePos(*pConnObj);
- aPosition.setX( aPosition.X() + aVector.Width() );
- aPosition.setY( aPosition.Y() + aVector.Height() );
+ aPosition.AdjustX(aVector.Width() );
+ aPosition.AdjustY(aVector.Height() );
pCloneEdge->SetTailPoint(false, aPosition);
}
}
@@ -577,8 +577,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
{
const SdrGluePoint& rGluePoint = (*pGlueList)[nInd];
Point aPosition = rGluePoint.GetAbsolutePos(*pConnObj);
- aPosition.setX( aPosition.X() + aVector.Width() );
- aPosition.setY( aPosition.Y() + aVector.Height() );
+ aPosition.AdjustX(aVector.Width() );
+ aPosition.AdjustY(aVector.Height() );
pCloneEdge->SetTailPoint(true, aPosition);
}
}
@@ -844,8 +844,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
::tools::Rectangle aRect( pObj->GetLogicRect() );
Size aSize( aRect.GetSize() );
- maDropPos.setX( maDropPos.X() - ( aSize.Width() >> 1 ) );
- maDropPos.setY( maDropPos.Y() - ( aSize.Height() >> 1 ) );
+ maDropPos.AdjustX( -( aSize.Width() >> 1 ) );
+ maDropPos.AdjustY( -( aSize.Height() >> 1 ) );
aRect.SetPos( maDropPos );
pObj->SetLogicRect( aRect );
@@ -991,8 +991,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
Size aMaxSize( mrDoc.GetMaxObjSize() );
- maDropPos.setX( maDropPos.X() - (std::min( aSize.Width(), aMaxSize.Width() ) >> 1) );
- maDropPos.setY( maDropPos.Y() - (std::min( aSize.Height(), aMaxSize.Height() ) >> 1) );
+ maDropPos.AdjustX( -(std::min( aSize.Width(), aMaxSize.Width() ) >> 1) );
+ maDropPos.AdjustY( -(std::min( aSize.Height(), aMaxSize.Height() ) >> 1) );
::tools::Rectangle aRect( maDropPos, aSize );
SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect );
@@ -1161,8 +1161,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
Size aMaxSize( mrDoc.GetMaxObjSize() );
- maDropPos.setX( maDropPos.X() - (std::min( aSize.Width(), aMaxSize.Width() ) >> 1) );
- maDropPos.setY( maDropPos.Y() - (std::min( aSize.Height(), aMaxSize.Height() ) >> 1) );
+ maDropPos.AdjustX( -(std::min( aSize.Width(), aMaxSize.Width() ) >> 1) );
+ maDropPos.AdjustY( -(std::min( aSize.Height(), aMaxSize.Height() ) >> 1) );
::tools::Rectangle aRect( maDropPos, aSize );
SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect );
@@ -1353,10 +1353,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
Point aHitPosB( rPos );
const SdrLayerIDSet* pVisiLayer = &GetSdrPageView()->GetVisibleLayers();
- aHitPosR.setX( aHitPosR.X() + n2HitLog );
- aHitPosL.setX( aHitPosL.X() - n2HitLog );
- aHitPosT.setY( aHitPosT.Y() + n2HitLog );
- aHitPosB.setY( aHitPosB.Y() - n2HitLog );
+ aHitPosR.AdjustX(n2HitLog );
+ aHitPosL.AdjustX( -n2HitLog );
+ aHitPosT.AdjustY(n2HitLog );
+ aHitPosB.AdjustY( -n2HitLog );
if( bClosed &&
SdrObjectPrimitiveHit(*pPickObj, aHitPosR, nHitLog, *GetSdrPageView(), pVisiLayer, false) &&