summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-20 11:03:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-21 06:04:19 +0100
commit924c0e34fdc36cd44100dafc2c68656ce32374e6 (patch)
tree05548e06d476b1244abb3ef83013514c7f991b3e /svx/source/svdraw
parentfd20935bb819cb24e71f4f91b97149c35bc5987d (diff)
loplugin:changetoolsgen in svx
and fix the regex in the plugin for matching += operator Change-Id: I26b3e3fac1d4ef3e756cc9431b983b5f27ee76d6 Reviewed-on: https://gerrit.libreoffice.org/50037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdcrtv.cxx8
-rw-r--r--svx/source/svdraw/svddrag.cxx8
-rw-r--r--svx/source/svdraw/svddrgmt.cxx68
-rw-r--r--svx/source/svdraw/svddrgv.cxx4
-rw-r--r--svx/source/svdraw/svdedtv1.cxx16
-rw-r--r--svx/source/svdraw/svdedtv2.cxx4
-rw-r--r--svx/source/svdraw/svdedxv.cxx80
-rw-r--r--svx/source/svdraw/svdetc.cxx16
-rw-r--r--svx/source/svdraw/svdfmtf.cxx26
-rw-r--r--svx/source/svdraw/svdglev.cxx4
-rw-r--r--svx/source/svdraw/svdglue.cxx40
-rw-r--r--svx/source/svdraw/svdhdl.cxx8
-rw-r--r--svx/source/svdraw/svdhlpln.cxx12
-rw-r--r--svx/source/svdraw/svdibrow.cxx10
-rw-r--r--svx/source/svdraw/svdmrkv.cxx24
-rw-r--r--svx/source/svdraw/svdmrkv1.cxx8
-rw-r--r--svx/source/svdraw/svdoashp.cxx112
-rw-r--r--svx/source/svdraw/svdobj.cxx96
-rw-r--r--svx/source/svdraw/svdocapt.cxx16
-rw-r--r--svx/source/svdraw/svdocirc.cxx56
-rw-r--r--svx/source/svdraw/svdoedge.cxx272
-rw-r--r--svx/source/svdraw/svdograf.cxx12
-rw-r--r--svx/source/svdraw/svdogrp.cxx8
-rw-r--r--svx/source/svdraw/svdomeas.cxx70
-rw-r--r--svx/source/svdraw/svdomedia.cxx12
-rw-r--r--svx/source/svdraw/svdopath.cxx36
-rw-r--r--svx/source/svdraw/svdorect.cxx22
-rw-r--r--svx/source/svdraw/svdotext.cxx38
-rw-r--r--svx/source/svdraw/svdotxat.cxx38
-rw-r--r--svx/source/svdraw/svdotxdr.cxx24
-rw-r--r--svx/source/svdraw/svdotxed.cxx34
-rw-r--r--svx/source/svdraw/svdotxtr.cxx12
-rw-r--r--svx/source/svdraw/svdpagv.cxx12
-rw-r--r--svx/source/svdraw/svdpntv.cxx2
-rw-r--r--svx/source/svdraw/svdsnpv.cxx20
-rw-r--r--svx/source/svdraw/svdtrans.cxx94
-rw-r--r--svx/source/svdraw/svdxcgv.cxx8
37 files changed, 665 insertions, 665 deletions
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 2b4351d5f5ba..b27b92964517 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -465,22 +465,22 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, cons
{
if(aPnt.X() < rWorkArea.Left())
{
- aPnt.X() = rWorkArea.Left();
+ aPnt.setX( rWorkArea.Left() );
}
if(aPnt.X() > rWorkArea.Right())
{
- aPnt.X() = rWorkArea.Right();
+ aPnt.setX( rWorkArea.Right() );
}
if(aPnt.Y() < rWorkArea.Top())
{
- aPnt.Y() = rWorkArea.Top();
+ aPnt.setY( rWorkArea.Top() );
}
if(aPnt.Y() > rWorkArea.Bottom())
{
- aPnt.Y() = rWorkArea.Bottom();
+ aPnt.setY( rWorkArea.Bottom() );
}
}
diff --git a/svx/source/svdraw/svddrag.cxx b/svx/source/svdraw/svddrag.cxx
index 5e123ffbd4c1..381a8def5f66 100644
--- a/svx/source/svdraw/svddrag.cxx
+++ b/svx/source/svdraw/svddrag.cxx
@@ -117,12 +117,12 @@ void SdrDragStat::TakeCreateRect(tools::Rectangle& rRect) const
rRect=tools::Rectangle(mvPnts[0], mvPnts.back());
if (mvPnts.size()>1) {
Point aBtmRgt(mvPnts[1]);
- rRect.Right()=aBtmRgt.X();
- rRect.Bottom()=aBtmRgt.Y();
+ rRect.SetRight(aBtmRgt.X() );
+ rRect.SetBottom(aBtmRgt.Y() );
}
if (pView!=nullptr && pView->IsCreate1stPointAsCenter()) {
- rRect.Top()+=rRect.Top()-rRect.Bottom();
- rRect.Left()+=rRect.Left()-rRect.Right();
+ rRect.AdjustTop(rRect.Top()-rRect.Bottom() );
+ rRect.AdjustLeft(rRect.Left()-rRect.Right() );
}
}
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 6233184ab494..1cb2f5aa8bd3 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -997,8 +997,8 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt)
Point aDif(aPnt-DragStat().GetStart());
getSdrDragView().CheckSnap(Ref1()+aDif,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
getSdrDragView().CheckSnap(Ref2()+aDif,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- aPnt.X()+=nBestXSnap;
- aPnt.Y()+=nBestYSnap;
+ aPnt.AdjustX(nBestXSnap );
+ aPnt.AdjustY(nBestYSnap );
}
if (aPnt!=DragStat().GetNow())
@@ -1061,8 +1061,8 @@ void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt)
// eliminate rounding errors for certain values
if (nSA==9000)
{
- if (nNewAngle==0 || nNewAngle==18000) aPnt.Y()=aRef.Y();
- if (nNewAngle==9000 || nNewAngle==27000) aPnt.X()=aRef.X();
+ if (nNewAngle==0 || nNewAngle==18000) aPnt.setY(aRef.Y() );
+ if (nNewAngle==9000 || nNewAngle==27000) aPnt.setX(aRef.X() );
}
if (nSA==4500)
@@ -1560,8 +1560,8 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_)
const tools::Rectangle& aSR=GetMarkedRect();
long nMovedx=aNoSnapPnt.X()-DragStat().GetStart().X();
long nMovedy=aNoSnapPnt.Y()-DragStat().GetStart().Y();
- Point aLO(aSR.TopLeft()); aLO.X()+=nMovedx; aLO.Y()+=nMovedy;
- Point aRU(aSR.BottomRight()); aRU.X()+=nMovedx; aRU.Y()+=nMovedy;
+ Point aLO(aSR.TopLeft()); aLO.AdjustX(nMovedx ); aLO.AdjustY(nMovedy );
+ Point aRU(aSR.BottomRight()); aRU.AdjustX(nMovedx ); aRU.AdjustY(nMovedy );
Point aLU(aLO.X(),aRU.Y());
Point aRO(aRU.X(),aLO.Y());
ImpCheckSnap(aLO);
@@ -1607,15 +1607,15 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_)
if (aSR2.Left()<aLR.Left())
{
- aPt1.X()-=aSR2.Left()-aLR.Left();
+ aPt1.AdjustX( -(aSR2.Left()-aLR.Left()) );
}
else if (aSR2.Right()>aLR.Right())
{
- aPt1.X()-=aSR2.Right()-aLR.Right();
+ aPt1.AdjustX( -(aSR2.Right()-aLR.Right()) );
}
}
else
- aPt1.X()=DragStat().GetStart().X(); // no space to move to
+ aPt1.setX(DragStat().GetStart().X() ); // no space to move to
if (aSR2.Top()>aLR.Top() || aSR2.Bottom()<aLR.Bottom())
{ // any space to move to?
@@ -1623,15 +1623,15 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_)
if (aSR2.Top()<aLR.Top())
{
- aPt1.Y()-=aSR2.Top()-aLR.Top();
+ aPt1.AdjustY( -(aSR2.Top()-aLR.Top()) );
}
else if (aSR2.Bottom()>aLR.Bottom())
{
- aPt1.Y()-=aSR2.Bottom()-aLR.Bottom();
+ aPt1.AdjustY( -(aSR2.Bottom()-aLR.Bottom()) );
}
}
else
- aPt1.Y()=DragStat().GetStart().Y(); // no space to move to
+ aPt1.setY(DragStat().GetStart().Y() ); // no space to move to
}
if (getSdrDragView().IsDraggingGluePoints())
@@ -1660,10 +1660,10 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_)
{
Point aPt((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
aPt+=aPt1; // move by this much
- if (aPt.X()<aBound.Left() ) aPt1.X()-=aPt.X()-aBound.Left() ;
- if (aPt.X()>aBound.Right() ) aPt1.X()-=aPt.X()-aBound.Right() ;
- if (aPt.Y()<aBound.Top() ) aPt1.Y()-=aPt.Y()-aBound.Top() ;
- if (aPt.Y()>aBound.Bottom()) aPt1.Y()-=aPt.Y()-aBound.Bottom();
+ if (aPt.X()<aBound.Left() ) aPt1.AdjustX( -(aPt.X()-aBound.Left()) ) ;
+ if (aPt.X()>aBound.Right() ) aPt1.AdjustX( -(aPt.X()-aBound.Right()) ) ;
+ if (aPt.Y()<aBound.Top() ) aPt1.AdjustY( -(aPt.Y()-aBound.Top()) ) ;
+ if (aPt.Y()>aBound.Bottom()) aPt1.AdjustY( -(aPt.Y()-aBound.Bottom()) );
}
}
}
@@ -1858,14 +1858,14 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt)
}
if (aPnt.X()<aLR.Left())
- aPnt.X()=aLR.Left();
+ aPnt.setX(aLR.Left() );
else if (aPnt.X()>aLR.Right())
- aPnt.X()=aLR.Right();
+ aPnt.setX(aLR.Right() );
if (aPnt.Y()<aLR.Top())
- aPnt.Y()=aLR.Top();
+ aPnt.setY(aLR.Top() );
else if (aPnt.Y()>aLR.Bottom())
- aPnt.Y()=aLR.Bottom();
+ aPnt.setY(aLR.Bottom() );
if (aRef.X()>aSR.Left())
{
@@ -2303,9 +2303,9 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt)
if (!bSlant && !bResize)
{ // shear, but no resize
if (bVertical)
- aPnt.X()=aP0.X();
+ aPnt.setX(aP0.X() );
else
- aPnt.Y()=aP0.Y();
+ aPnt.setY(aP0.Y() );
}
Point aRef(DragStat().GetRef1());
@@ -3100,22 +3100,22 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
if (bVertical)
{
- aNeuCenter.X()=aStart.X();
- aNeuCenter.Y()=aMarkCenter.Y();
+ aNeuCenter.setX(aStart.X() );
+ aNeuCenter.setY(aMarkCenter.Y() );
}
if (!getSdrDragView().IsCrookAtCenter())
{
switch (GetDragHdlKind())
{
- case SdrHdlKind::UpperLeft: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break;
- case SdrHdlKind::Upper: aNeuCenter.Y()=aMarkRect.Bottom(); bUpr=true; break;
- case SdrHdlKind::UpperRight: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break;
- case SdrHdlKind::Left : aNeuCenter.X()=aMarkRect.Right(); bLft=true; break;
- case SdrHdlKind::Right: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break;
- case SdrHdlKind::LowerLeft: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break;
- case SdrHdlKind::Lower: aNeuCenter.Y()=aMarkRect.Top(); bLwr=true; break;
- case SdrHdlKind::LowerRight: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break;
+ case SdrHdlKind::UpperLeft: aNeuCenter.setX(aMarkRect.Right() ); bLft=true; break;
+ case SdrHdlKind::Upper: aNeuCenter.setY(aMarkRect.Bottom() ); bUpr=true; break;
+ case SdrHdlKind::UpperRight: aNeuCenter.setX(aMarkRect.Left() ); bRgt=true; break;
+ case SdrHdlKind::Left : aNeuCenter.setX(aMarkRect.Right() ); bLft=true; break;
+ case SdrHdlKind::Right: aNeuCenter.setX(aMarkRect.Left() ); bRgt=true; break;
+ case SdrHdlKind::LowerLeft: aNeuCenter.setX(aMarkRect.Right() ); bLft=true; break;
+ case SdrHdlKind::Lower: aNeuCenter.setY(aMarkRect.Top() ); bLwr=true; break;
+ case SdrHdlKind::LowerRight: aNeuCenter.setX(aMarkRect.Left() ); bRgt=true; break;
default: bAtCenter=true;
}
}
@@ -3147,14 +3147,14 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
{
a=static_cast<double>(dy1)/static_cast<double>(dx1); // slope of the radius
nNeuRad=(static_cast<long>(dy1*a)+dx1) /2;
- aNeuCenter.X()+=nNeuRad;
+ aNeuCenter.AdjustX(nNeuRad );
nPntWink=GetAngle(aPnt-aNeuCenter);
}
else
{
a=static_cast<double>(dx1)/static_cast<double>(dy1); // slope of the radius
nNeuRad=(static_cast<long>(dx1*a)+dy1) /2;
- aNeuCenter.Y()+=nNeuRad;
+ aNeuCenter.AdjustY(nNeuRad );
nPntWink=GetAngle(aPnt-aNeuCenter)-9000;
}
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 29293f1c7540..b13383b27a32 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -177,8 +177,8 @@ bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, bool bTR ) const
{
// drag the whole Object (Move, Resize, ...)
const basegfx::B2DPoint aTransformed(mpCurrentSdrDragMethod->getCurrentTransformation() * basegfx::B2DPoint(aPt.X(), aPt.Y()));
- rPos.X() = basegfx::fround(aTransformed.getX());
- rPos.Y() = basegfx::fround(aTransformed.getY());
+ rPos.setX( basegfx::fround(aTransformed.getX()) );
+ rPos.setY( basegfx::fround(aTransformed.getY()) );
}
}
}
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index d2469a703c67..beb7abfeabda 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -121,10 +121,10 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect)
} else {
t=0; b=h1;
}
- aR1.Left ()=long(l);
- aR1.Right ()=long(r);
- aR1.Top ()=long(t);
- aR1.Bottom()=long(b);
+ aR1.SetLeft(long(l) );
+ aR1.SetRight(long(r) );
+ aR1.SetTop(long(t) );
+ aR1.SetBottom(long(b) );
aR1.Move(x1,y1);
}
pO->SetSnapRect(aR1);
@@ -424,7 +424,7 @@ void SdrEditView::MirrorMarkedObjHorizontal()
{
Point aCenter(GetMarkedObjRect().Center());
Point aPt2(aCenter);
- aPt2.Y()++;
+ aPt2.AdjustY( 1 );
MirrorMarkedObj(aCenter,aPt2);
}
@@ -432,7 +432,7 @@ void SdrEditView::MirrorMarkedObjVertical()
{
Point aCenter(GetMarkedObjRect().Center());
Point aPt2(aCenter);
- aPt2.X()++;
+ aPt2.AdjustX( 1 );
MirrorMarkedObj(aCenter,aPt2);
}
@@ -731,8 +731,8 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr)
tools::Rectangle aRect(aAllSnapRect); // TODO: change this for PolyPt's and GluePt's!!!
if (bAllPosX) aRect.Move(nAllPosX-aRect.Left(),0);
if (bAllPosY) aRect.Move(0,nAllPosY-aRect.Top());
- if (bAllWdt) aRect.Right()=aAllSnapRect.Left()+nAllWdt;
- if (bAllHgt) aRect.Bottom()=aAllSnapRect.Top()+nAllHgt;
+ if (bAllWdt) aRect.SetRight(aAllSnapRect.Left()+nAllWdt );
+ if (bAllHgt) aRect.SetBottom(aAllSnapRect.Top()+nAllHgt );
SetMarkedObjRect(aRect);
}
if (rAttr.GetItemState(SDRATTR_RESIZEXALL,true,&pPoolItem)==SfxItemState::SET) {
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 8be4649c50c0..ac1f11f834f9 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1209,9 +1209,9 @@ void SdrEditView::EqualizeMarkedObjects(bool bWidth)
tools::Rectangle aLogicRect(pObj->GetLogicRect());
Size aLogicRectSize(aLogicRect.GetSize());
if (bWidth)
- aLogicRectSize.Width() = aLastRectSize.Width();
+ aLogicRectSize.setWidth( aLastRectSize.Width() );
else
- aLogicRectSize.Height() = aLastRectSize.Height();
+ aLogicRectSize.setHeight( aLastRectSize.Height() );
aLogicRect.SetSize(aLogicRectSize);
if (bUndo)
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f239c5cb5b8b..0539648713d6 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -337,10 +337,10 @@ void SdrObjEditView::ModelHasChanged()
tools::Rectangle aTmpRect(aOldArea);
sal_uInt16 nPixSiz=pOLV->GetInvalidateMore()+1;
Size aMore(pWin->PixelToLogic(Size(nPixSiz,nPixSiz)));
- aTmpRect.Left()-=aMore.Width();
- aTmpRect.Right()+=aMore.Width();
- aTmpRect.Top()-=aMore.Height();
- aTmpRect.Bottom()+=aMore.Height();
+ aTmpRect.AdjustLeft( -(aMore.Width()) );
+ aTmpRect.AdjustRight(aMore.Width() );
+ aTmpRect.AdjustTop( -(aMore.Height()) );
+ aTmpRect.AdjustBottom(aMore.Height() );
InvalidateOneWin(*pWin,aTmpRect);
}
if (bAnchorChg)
@@ -775,10 +775,10 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView const & rOutlView) c
tools::Rectangle aPixRect(pWin->LogicToPixel(aBlankRect));
sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
- aPixRect.Left()--;
- aPixRect.Top()--;
- aPixRect.Right()++;
- aPixRect.Bottom()++;
+ aPixRect.AdjustLeft( -1 );
+ aPixRect.AdjustTop( -1 );
+ aPixRect.AdjustRight( 1 );
+ aPixRect.AdjustBottom( 1 );
{
// limit xPixRect because of driver problems when pixel coordinates are too far out
@@ -787,17 +787,17 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView const & rOutlView) c
long nMaxX(aMaxXY.Width() + a);
long nMaxY(aMaxXY.Height() + a);
- if (aPixRect.Left ()<-a) aPixRect.Left()=-a;
- if (aPixRect.Top ()<-a) aPixRect.Top ()=-a;
- if (aPixRect.Right ()>nMaxX) aPixRect.Right ()=nMaxX;
- if (aPixRect.Bottom()>nMaxY) aPixRect.Bottom()=nMaxY;
+ if (aPixRect.Left ()<-a) aPixRect.SetLeft(-a );
+ if (aPixRect.Top ()<-a) aPixRect.SetTop(-a );
+ if (aPixRect.Right ()>nMaxX) aPixRect.SetRight(nMaxX );
+ if (aPixRect.Bottom()>nMaxY) aPixRect.SetBottom(nMaxY );
}
tools::Rectangle aOuterPix(aPixRect);
- aOuterPix.Left()-=nPixSiz;
- aOuterPix.Top()-=nPixSiz;
- aOuterPix.Right()+=nPixSiz;
- aOuterPix.Bottom()+=nPixSiz;
+ aOuterPix.AdjustLeft( -nPixSiz );
+ aOuterPix.AdjustTop( -nPixSiz );
+ aOuterPix.AdjustRight(nPixSiz );
+ aOuterPix.AdjustBottom(nPixSiz );
bool bMerk(pWin->IsMapModeEnabled());
pWin->EnableMapMode(false);
@@ -1558,10 +1558,10 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
aRect.Union(aTextEditArea);
aRect.Union(aMinTextEditArea);
aRect=pWin->LogicToPixel(aRect);
- aRect.Left()-=nMorePix;
- aRect.Top()-=nMorePix;
- aRect.Right()+=nMorePix;
- aRect.Bottom()+=nMorePix;
+ aRect.AdjustLeft( -nMorePix );
+ aRect.AdjustTop( -nMorePix );
+ aRect.AdjustRight(nMorePix );
+ aRect.AdjustBottom(nMorePix );
aRect=pWin->PixelToLogic(aRect);
InvalidateOneWin(*pWin,aRect);
pWin->SetFillColor();
@@ -1703,10 +1703,10 @@ bool SdrObjEditView::IsTextEditFrameHit(const Point& rHit) const
aEditArea.Union(pOLV->GetOutputArea());
if (!aEditArea.IsInside(rHit)) {
Size aSiz(pWin->PixelToLogic(Size(nPixSiz,nPixSiz)));
- aEditArea.Left()-=aSiz.Width();
- aEditArea.Top()-=aSiz.Height();
- aEditArea.Right()+=aSiz.Width();
- aEditArea.Bottom()+=aSiz.Height();
+ aEditArea.AdjustLeft( -(aSiz.Width()) );
+ aEditArea.AdjustTop( -(aSiz.Height()) );
+ aEditArea.AdjustRight(aSiz.Width() );
+ aEditArea.AdjustBottom(aSiz.Height() );
bOk=aEditArea.IsInside(rHit);
}
}
@@ -1790,10 +1790,10 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin)
if (pWin)
{
tools::Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ if (aPixPos.X()<aR.Left ()) aPixPos.setX(aR.Left () );
+ if (aPixPos.X()>aR.Right ()) aPixPos.setX(aR.Right () );
+ if (aPixPos.Y()<aR.Top ()) aPixPos.setY(aR.Top () );
+ if (aPixPos.Y()>aR.Bottom()) aPixPos.setY(aR.Bottom() );
}
MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
rMEvt.GetButtons(),rMEvt.GetModifier());
@@ -1823,10 +1823,10 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin)
if (bPostIt && pWin) {
Point aPixPos(rMEvt.GetPosPixel());
tools::Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ if (aPixPos.X()<aR.Left ()) aPixPos.setX(aR.Left () );
+ if (aPixPos.X()>aR.Right ()) aPixPos.setX(aR.Right () );
+ if (aPixPos.Y()<aR.Top ()) aPixPos.setY(aR.Top () );
+ if (aPixPos.Y()>aR.Bottom()) aPixPos.setY(aR.Bottom() );
MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseButtonUp(aMEvt)) {
@@ -1861,10 +1861,10 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin)
aR = pWin->LogicToPixel(aR);
else if (pTextEditWin)
aR = pTextEditWin->LogicToPixel(aR);
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ if (aPixPos.X()<aR.Left ()) aPixPos.setX(aR.Left () );
+ if (aPixPos.X()>aR.Right ()) aPixPos.setX(aR.Right () );
+ if (aPixPos.Y()<aR.Top ()) aPixPos.setY(aR.Top () );
+ if (aPixPos.Y()>aR.Bottom()) aPixPos.setY(aR.Bottom() );
MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseMove(aMEvt) && bSelMode) {
@@ -1896,10 +1896,10 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
Point aPixPos(rCEvt.GetMousePosPixel());
if (rCEvt.IsMouseEvent() && pWin) {
tools::Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ if (aPixPos.X()<aR.Left ()) aPixPos.setX(aR.Left () );
+ if (aPixPos.X()>aR.Right ()) aPixPos.setX(aR.Right () );
+ if (aPixPos.Y()<aR.Top ()) aPixPos.setY(aR.Top () );
+ if (aPixPos.Y()>aR.Bottom()) aPixPos.setY(aR.Bottom() );
}
CommandEvent aCEvt(aPixPos,rCEvt.GetCommand(),rCEvt.IsMouseEvent());
// Command is void at the OutlinerView, sadly
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 5b1b2695dce6..823dc300f3e9 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -648,8 +648,8 @@ namespace
{
// TopLeft-Spot
aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth14;
- aSpotPos[i].Y() += nHeight14;
+ aSpotPos[i].AdjustX(nWidth14 );
+ aSpotPos[i].AdjustY(nHeight14 );
}
break;
@@ -657,8 +657,8 @@ namespace
{
// TopRight-Spot
aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth34;
- aSpotPos[i].Y() += nHeight14;
+ aSpotPos[i].AdjustX(nWidth34 );
+ aSpotPos[i].AdjustY(nHeight14 );
}
break;
@@ -666,8 +666,8 @@ namespace
{
// BottomLeft-Spot
aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth14;
- aSpotPos[i].Y() += nHeight34;
+ aSpotPos[i].AdjustX(nWidth14 );
+ aSpotPos[i].AdjustY(nHeight34 );
}
break;
@@ -675,8 +675,8 @@ namespace
{
// BottomRight-Spot
aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth34;
- aSpotPos[i].Y() += nHeight34;
+ aSpotPos[i].AdjustX(nWidth34 );
+ aSpotPos[i].AdjustY(nHeight34 );
}
break;
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 9197c1f7eea4..457095f6adc0 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -984,9 +984,9 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt
Size aSize( nTextWidth, nTextHeight );
if ( eAlg == ALIGN_BASELINE )
- aPos.Y() -= FRound(aFontMetric.GetAscent() * mfScaleY);
+ aPos.AdjustY( -(FRound(aFontMetric.GetAscent() * mfScaleY)) );
else if ( eAlg == ALIGN_BOTTOM )
- aPos.Y() -= nTextHeight;
+ aPos.AdjustY( -nTextHeight );
tools::Rectangle aTextRect( aPos, aSize );
SdrRectObj* pText =new SdrRectObj( OBJ_TEXT, aTextRect );
@@ -1057,7 +1057,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaStretchTextAction const & rAct)
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
@@ -1069,7 +1069,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction const & rAct)
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
@@ -1081,7 +1081,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction const & rAct)
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect );
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
@@ -1093,7 +1093,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction const & rAct)
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect );
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
@@ -1271,8 +1271,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct)
tools::Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
Bitmap aBitmap(rAct.GetBitmap());
- aRect.Right()++;
- aRect.Bottom()++;
+ aRect.AdjustRight( 1 );
+ aRect.AdjustBottom( 1 );
aBitmap.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
SdrGrafObj* pGraf = new SdrGrafObj(aBitmap, aRect);
@@ -1287,8 +1287,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScalePartAction const & rAct)
tools::Rectangle aRect(rAct.GetDestPoint(),rAct.GetDestSize());
BitmapEx aBitmapEx(rAct.GetBitmapEx());
- aRect.Right()++;
- aRect.Bottom()++;
+ aRect.AdjustRight( 1 );
+ aRect.AdjustBottom( 1 );
aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
@@ -1303,7 +1303,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskAction const & rAct)
tools::Rectangle aRect(rAct.GetPoint(), rAct.GetBitmap().GetSizePixel());
BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
@@ -1317,7 +1317,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskScaleAction const & rAct)
tools::Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
@@ -1331,7 +1331,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskScalePartAction const & rAct)
tools::Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
- aRect.Right()++; aRect.Bottom()++;
+ aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index 86f3212841b1..64da87b646ab 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -347,8 +347,8 @@ void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const vo
static void ImpMove(Point& rPt, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/)
{
- rPt.X()+=static_cast<const Size*>(p1)->Width();
- rPt.Y()+=static_cast<const Size*>(p1)->Height();
+ rPt.AdjustX(static_cast<const Size*>(p1)->Width() );
+ rPt.AdjustY(static_cast<const Size*>(p1)->Height() );
}
void SdrGlueEditView::MoveMarkedGluePoints(const Size& rSiz, bool bCopy)
diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index d8f6f9e4a31b..cb253b121444 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -52,13 +52,13 @@ Point SdrGluePoint::GetAbsolutePos(const SdrObject& rObj) const
Point aOfs(aSnap.Center());
switch (GetHorzAlign()) {
- case SdrAlign::HORZ_LEFT : aOfs.X()=aSnap.Left(); break;
- case SdrAlign::HORZ_RIGHT : aOfs.X()=aSnap.Right(); break;
+ case SdrAlign::HORZ_LEFT : aOfs.setX(aSnap.Left() ); break;
+ case SdrAlign::HORZ_RIGHT : aOfs.setX(aSnap.Right() ); break;
default: break;
}
switch (GetVertAlign()) {
- case SdrAlign::VERT_TOP : aOfs.Y()=aSnap.Top(); break;
- case SdrAlign::VERT_BOTTOM: aOfs.Y()=aSnap.Bottom(); break;
+ case SdrAlign::VERT_TOP : aOfs.setY(aSnap.Top() ); break;
+ case SdrAlign::VERT_BOTTOM: aOfs.setY(aSnap.Bottom() ); break;
default: break;
}
if (!bNoPercent) {
@@ -67,20 +67,20 @@ Point SdrGluePoint::GetAbsolutePos(const SdrObject& rObj) const
long nXDiv=10000;
long nYDiv=10000;
if (nXMul!=nXDiv) {
- aPt.X()*=nXMul;
- aPt.X()/=nXDiv;
+ aPt.setX( aPt.X() * nXMul );
+ aPt.setX( aPt.X() / nXDiv );
}
if (nYMul!=nYDiv) {
- aPt.Y()*=nYMul;
- aPt.Y()/=nYDiv;
+ aPt.setY( aPt.Y() * nYMul );
+ aPt.setY( aPt.Y() / nYDiv );
}
}
aPt+=aOfs;
// Now limit to the BoundRect of the object
- if (aPt.X()<aBound.Left ()) aPt.X()=aBound.Left ();
- if (aPt.X()>aBound.Right ()) aPt.X()=aBound.Right ();
- if (aPt.Y()<aBound.Top ()) aPt.Y()=aBound.Top ();
- if (aPt.Y()>aBound.Bottom()) aPt.Y()=aBound.Bottom();
+ if (aPt.X()<aBound.Left ()) aPt.setX(aBound.Left () );
+ if (aPt.X()>aBound.Right ()) aPt.setX(aBound.Right () );
+ if (aPt.Y()<aBound.Top ()) aPt.setY(aBound.Top () );
+ if (aPt.Y()>aBound.Bottom()) aPt.setY(aBound.Bottom() );
return aPt;
}
@@ -95,13 +95,13 @@ void SdrGluePoint::SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj)
Point aOfs(aSnap.Center());
switch (GetHorzAlign()) {
- case SdrAlign::HORZ_LEFT : aOfs.X()=aSnap.Left(); break;
- case SdrAlign::HORZ_RIGHT : aOfs.X()=aSnap.Right(); break;
+ case SdrAlign::HORZ_LEFT : aOfs.setX(aSnap.Left() ); break;
+ case SdrAlign::HORZ_RIGHT : aOfs.setX(aSnap.Right() ); break;
default: break;
}
switch (GetVertAlign()) {
- case SdrAlign::VERT_TOP : aOfs.Y()=aSnap.Top(); break;
- case SdrAlign::VERT_BOTTOM: aOfs.Y()=aSnap.Bottom(); break;
+ case SdrAlign::VERT_TOP : aOfs.setY(aSnap.Top() ); break;
+ case SdrAlign::VERT_BOTTOM: aOfs.setY(aSnap.Bottom() ); break;
default: break;
}
aPt-=aOfs;
@@ -113,12 +113,12 @@ void SdrGluePoint::SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj)
long nXDiv=10000;
long nYDiv=10000;
if (nXMul!=nXDiv) {
- aPt.X()*=nXDiv;
- aPt.X()/=nXMul;
+ aPt.setX( aPt.X() * nXDiv );
+ aPt.setX( aPt.X() / nXMul );
}
if (nYMul!=nYDiv) {
- aPt.Y()*=nYDiv;
- aPt.Y()/=nYMul;
+ aPt.setY( aPt.Y() * nYDiv );
+ aPt.setY( aPt.Y() / nYMul );
}
}
aPos=aPt;
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 293674a88314..cd3bc2f5fcb6 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -554,13 +554,13 @@ void SdrHdl::CreateB2dIAObject()
Size aOffset = rOutDev.PixelToLogic(Size(4, 4));
if(eKind == SdrHdlKind::UpperLeft || eKind == SdrHdlKind::Upper || eKind == SdrHdlKind::UpperRight)
- aMoveOutsideOffset.Y() -= aOffset.Width();
+ aMoveOutsideOffset.AdjustY( -(aOffset.Width()) );
if(eKind == SdrHdlKind::LowerLeft || eKind == SdrHdlKind::Lower || eKind == SdrHdlKind::LowerRight)
- aMoveOutsideOffset.Y() += aOffset.Height();
+ aMoveOutsideOffset.AdjustY(aOffset.Height() );
if(eKind == SdrHdlKind::UpperLeft || eKind == SdrHdlKind::Left || eKind == SdrHdlKind::LowerLeft)
- aMoveOutsideOffset.X() -= aOffset.Width();
+ aMoveOutsideOffset.AdjustX( -(aOffset.Width()) );
if(eKind == SdrHdlKind::UpperRight || eKind == SdrHdlKind::Right || eKind == SdrHdlKind::LowerRight)
- aMoveOutsideOffset.X() += aOffset.Height();
+ aMoveOutsideOffset.AdjustX(aOffset.Height() );
}
rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager();
diff --git a/svx/source/svdraw/svdhlpln.cxx b/svx/source/svdraw/svdhlpln.cxx
index a1260d51dd95..1baff3ebd537 100644
--- a/svx/source/svdraw/svdhlpln.cxx
+++ b/svx/source/svdraw/svdhlpln.cxx
@@ -60,14 +60,14 @@ tools::Rectangle SdrHelpLine::GetBoundRect(const OutputDevice& rOut) const
Point aOfs(rOut.GetMapMode().GetOrigin());
Size aSiz(rOut.GetOutputSize());
switch (eKind) {
- case SdrHelpLineKind::Vertical : aRet.Top()=-aOfs.Y(); aRet.Bottom()=-aOfs.Y()+aSiz.Height(); break;
- case SdrHelpLineKind::Horizontal: aRet.Left()=-aOfs.X(); aRet.Right()=-aOfs.X()+aSiz.Width(); break;
+ case SdrHelpLineKind::Vertical : aRet.SetTop(-aOfs.Y() ); aRet.SetBottom(-aOfs.Y()+aSiz.Height() ); break;
+ case SdrHelpLineKind::Horizontal: aRet.SetLeft(-aOfs.X() ); aRet.SetRight(-aOfs.X()+aSiz.Width() ); break;
case SdrHelpLineKind::Point : {
Size aRad(rOut.PixelToLogic(Size(SDRHELPLINE_POINT_PIXELSIZE,SDRHELPLINE_POINT_PIXELSIZE)));
- aRet.Left() -=aRad.Width();
- aRet.Right() +=aRad.Width();
- aRet.Top() -=aRad.Height();
- aRet.Bottom()+=aRad.Height();
+ aRet.AdjustLeft( -(aRad.Width()) );
+ aRet.AdjustRight(aRad.Width() );
+ aRet.AdjustTop( -(aRad.Height()) );
+ aRet.AdjustBottom(aRad.Height() );
} break;
} // switch
return aRet;
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 6e1f04d693ce..c36516c65a2b 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -333,7 +333,7 @@ void SdrItemBrowserControl::PaintField(OutputDevice& rDev, const tools::Rectangl
return;
}
tools::Rectangle aR(rRect);
- aR.Bottom()++;
+ aR.AdjustBottom( 1 );
auto& pEntry=aList[nAktPaintRow];
if (pEntry->bComment)
{
@@ -341,8 +341,8 @@ void SdrItemBrowserControl::PaintField(OutputDevice& rDev, const tools::Rectangl
{
rDev.SetLineColor();
rDev.SetFillColor( Color( COL_LIGHTGRAY ) );
- aR.Left()=0;
- aR.Right()=rDev.GetOutputSize().Width();
+ aR.SetLeft(0 );
+ aR.SetRight(rDev.GetOutputSize().Width() );
rDev.DrawRect(aR);
rDev.DrawText(rRect.TopLeft(),pEntry->aName);
}
@@ -477,8 +477,8 @@ bool SdrItemBrowserControl::BeginChangeEntry(std::size_t nPos)
SetMode(MYBROWSEMODE & BrowserMode(~BrowserMode::KEEPHIGHLIGHT));
pEditControl=VclPtr<ImpItemEdit>::Create(&GetDataWindow(),this,0);
tools::Rectangle aRect(GetFieldRectPixel(nPos, ITEMBROWSER_VALUECOL_ID, false));
- aRect.Left()+=2; // little offset for the Edit, so it's exact to the pixel
- aRect.Right()--;
+ aRect.AdjustLeft(2 ); // little offset for the Edit, so it's exact to the pixel
+ aRect.AdjustRight( -1 );
pEditControl->SetPosSizePixel(aRect.TopLeft(),aRect.GetSize());
pEditControl->SetText(pEntry->aValue);
pEditControl->SetBackground( Wallpaper(Color(COL_LIGHTGRAY)));
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 85ede4828fa7..985b415ca3b6 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1268,10 +1268,10 @@ void SdrMarkView::ForceRefToMarked()
}
}
- maRef1.X()=aCenter.X();
- maRef1.Y()=nY1;
- maRef2.X()=aCenter.X();
- maRef2.Y()=nY2;
+ maRef1.setX(aCenter.X() );
+ maRef1.setY(nY1 );
+ maRef2.setX(aCenter.X() );
+ maRef2.setY(nY2 );
break;
}
@@ -1698,10 +1698,10 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
nTol2*=2;
}
- aRect.Left ()-=nTol2; // add 1 tolerance for all objects
- aRect.Top ()-=nTol2;
- aRect.Right ()+=nTol2;
- aRect.Bottom()+=nTol2;
+ aRect.AdjustLeft( -nTol2 ); // add 1 tolerance for all objects
+ aRect.AdjustTop( -nTol2 );
+ aRect.AdjustRight(nTol2 );
+ aRect.AdjustBottom(nTol2 );
if (aRect.IsInside(rPnt))
{
@@ -1935,10 +1935,10 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie
SdrPageView* pPV=pM->GetPageView();
SdrObject* pObj=pM->GetMarkedSdrObj();
tools::Rectangle aRect(pObj->GetCurrentBoundRect());
- aRect.Left ()-=mnHitTolLog;
- aRect.Top ()-=mnHitTolLog;
- aRect.Right ()+=mnHitTolLog;
- aRect.Bottom()+=mnHitTolLog;
+ aRect.AdjustLeft( -(mnHitTolLog) );
+ aRect.AdjustTop( -(mnHitTolLog) );
+ aRect.AdjustRight(mnHitTolLog );
+ aRect.AdjustBottom(mnHitTolLog );
if (aRect.IsInside(rPnt)) {
rpObj=pObj;
rpPV=pPV;
diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index 85a2e193fb7b..8c5cd6b12647 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -292,10 +292,10 @@ void SdrMarkView::ImpSetPointsRects() const
if (rR.IsEmpty()) {
rR=tools::Rectangle(aPt,aPt);
} else {
- if (aPt.X()<rR.Left ()) rR.Left ()=aPt.X();
- if (aPt.X()>rR.Right ()) rR.Right ()=aPt.X();
- if (aPt.Y()<rR.Top ()) rR.Top ()=aPt.Y();
- if (aPt.Y()>rR.Bottom()) rR.Bottom()=aPt.Y();
+ if (aPt.X()<rR.Left ()) rR.SetLeft(aPt.X() );
+ if (aPt.X()>rR.Right ()) rR.SetRight(aPt.X() );
+ if (aPt.Y()<rR.Top ()) rR.SetTop(aPt.Y() );
+ if (aPt.Y()>rR.Bottom()) rR.SetBottom(aPt.Y() );
}
}
}
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 3b7ccaf33dae..7b6dddf2fabd 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1669,10 +1669,10 @@ SdrGluePoint SdrObjCustomShape::GetVertexGluePoint(sal_uInt16 nPosNum) const
Point aPt;
switch (nPosNum) {
- case 0: aPt=maRect.TopCenter(); aPt.Y()-=nWdt; break;
- case 1: aPt=maRect.RightCenter(); aPt.X()+=nWdt; break;
- case 2: aPt=maRect.BottomCenter(); aPt.Y()+=nWdt; break;
- case 3: aPt=maRect.LeftCenter(); aPt.X()-=nWdt; break;
+ case 0: aPt=maRect.TopCenter(); aPt.AdjustY( -nWdt ); break;
+ case 1: aPt=maRect.RightCenter(); aPt.AdjustX(nWdt ); break;
+ case 2: aPt=maRect.BottomCenter(); aPt.AdjustY(nWdt ); break;
+ case 3: aPt=maRect.LeftCenter(); aPt.AdjustX( -nWdt ); break;
}
if (aGeo.nShearAngle!=0) ShearPoint(aPt,maRect.TopLeft(),aGeo.nTan);
if (aGeo.nRotationAngle!=0) RotatePoint(aPt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos);
@@ -1751,11 +1751,11 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
RotatePoint( aGlue, aRef, sin( fObjectRotation * F_PI180 ), cos( fObjectRotation * F_PI180 ) );
if ( bMirroredX )
- aGlue.X() = maRect.GetWidth() - aGlue.X();
+ aGlue.setX( maRect.GetWidth() - aGlue.X() );
if ( bMirroredY )
- aGlue.Y() = maRect.GetHeight() - aGlue.Y();
- aGlue.X() -= nXDiff;
- aGlue.Y() -= nYDiff;
+ aGlue.setY( maRect.GetHeight() - aGlue.Y() );
+ aGlue.AdjustX( -nXDiff );
+ aGlue.AdjustY( -nYDiff );
rPoint.SetPos( aGlue );
}
}
@@ -2241,18 +2241,18 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool
tools::Rectangle aR0(rR);
long nHgt=0,nMinHgt=0,nMaxHgt=0;
long nWdt=0,nMinWdt=0,nMaxWdt=0;
- Size aSiz(rR.GetSize()); aSiz.Width()--; aSiz.Height()--;
+ Size aSiz(rR.GetSize()); aSiz.AdjustWidth( -1 ); aSiz.AdjustHeight( -1 );
Size aMaxSiz(100000,100000);
Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
+ if (aTmpSiz.Width()!=0) aMaxSiz.setWidth(aTmpSiz.Width() );
+ if (aTmpSiz.Height()!=0) aMaxSiz.setHeight(aTmpSiz.Height() );
if (bWdtGrow)
{
nMinWdt=GetMinTextFrameWidth();
nMaxWdt=GetMaxTextFrameWidth();
if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width();
if (nMinWdt<=0) nMinWdt=1;
- aSiz.Width()=nMaxWdt;
+ aSiz.setWidth(nMaxWdt );
}
if (bHgtGrow)
{
@@ -2260,16 +2260,16 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool
nMaxHgt=GetMaxTextFrameHeight();
if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
if (nMinHgt<=0) nMinHgt=1;
- aSiz.Height()=nMaxHgt;
+ aSiz.setHeight(nMaxHgt );
}
long nHDist=GetTextLeftDistance()+GetTextRightDistance();
long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- aSiz.Width()-=nHDist;
- aSiz.Height()-=nVDist;
+ aSiz.AdjustWidth( -nHDist );
+ aSiz.AdjustHeight( -nVDist );
if ( aSiz.Width() < 2 )
- aSiz.Width() = 2; // minimum size=2
+ aSiz.setWidth( 2 ); // minimum size=2
if ( aSiz.Height() < 2 )
- aSiz.Height() = 2; // minimum size=2
+ aSiz.setHeight( 2 ); // minimum size=2
if (HasText())
{
@@ -2341,28 +2341,28 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool
{
SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust();
if ( eHAdj == SDRTEXTHORZADJUST_LEFT )
- rR.Right()+=nWdtGrow;
+ rR.AdjustRight(nWdtGrow );
else if ( eHAdj == SDRTEXTHORZADJUST_RIGHT )
- rR.Left()-=nWdtGrow;
+ rR.AdjustLeft( -nWdtGrow );
else
{
long nWdtGrow2=nWdtGrow/2;
- rR.Left()-=nWdtGrow2;
- rR.Right()=rR.Left()+nWdt;
+ rR.AdjustLeft( -nWdtGrow2 );
+ rR.SetRight(rR.Left()+nWdt );
}
}
if ( bHgtGrow )
{
SdrTextVertAdjust eVAdj=GetTextVerticalAdjust();
if ( eVAdj == SDRTEXTVERTADJUST_TOP )
- rR.Bottom()+=nHgtGrow;
+ rR.AdjustBottom(nHgtGrow );
else if ( eVAdj == SDRTEXTVERTADJUST_BOTTOM )
- rR.Top()-=nHgtGrow;
+ rR.AdjustTop( -nHgtGrow );
else
{
long nHgtGrow2=nHgtGrow/2;
- rR.Top()-=nHgtGrow2;
- rR.Bottom()=rR.Top()+nHgt;
+ rR.AdjustTop( -nHgtGrow2 );
+ rR.SetBottom(rR.Top()+nHgt );
}
}
if ( aGeo.nRotationAngle )
@@ -2403,10 +2403,10 @@ tools::Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, cons
double fLeftDiff = static_cast<double>( aAdjustedTextRect.Left() - aNewTextRect.Left() ) * fXScale;
double fTopDiff = static_cast<double>( aAdjustedTextRect.Top() - aNewTextRect.Top() ) * fYScale;
double fBottomDiff= static_cast<double>( aAdjustedTextRect.Bottom()- aNewTextRect.Bottom()) * fYScale;
- aReturnValue.Left() += static_cast<sal_Int32>(fLeftDiff);
- aReturnValue.Right() += static_cast<sal_Int32>(fRightDiff);
- aReturnValue.Top() += static_cast<sal_Int32>(fTopDiff);
- aReturnValue.Bottom() += static_cast<sal_Int32>(fBottomDiff);
+ aReturnValue.AdjustLeft(static_cast<sal_Int32>(fLeftDiff) );
+ aReturnValue.AdjustRight(static_cast<sal_Int32>(fRightDiff) );
+ aReturnValue.AdjustTop(static_cast<sal_Int32>(fTopDiff) );
+ aReturnValue.AdjustBottom(static_cast<sal_Int32>(fBottomDiff) );
}
}
return aReturnValue;
@@ -2497,12 +2497,12 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools
aViewInit.Move(aCenter.X(),aCenter.Y());
}
Size aAnkSiz(aViewInit.GetSize());
- aAnkSiz.Width()--; aAnkSiz.Height()--; // because GetSize() adds 1
+ aAnkSiz.AdjustWidth( -1 ); aAnkSiz.AdjustHeight( -1 ); // because GetSize() adds 1
Size aMaxSiz(1000000,1000000);
if (pModel!=nullptr) {
Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
+ if (aTmpSiz.Width()!=0) aMaxSiz.setWidth(aTmpSiz.Width() );
+ if (aTmpSiz.Height()!=0) aMaxSiz.setHeight(aTmpSiz.Height() );
}
SdrTextHorzAdjust eHAdj(GetTextHorizontalAdjust());
SdrTextVertAdjust eVAdj(GetTextVerticalAdjust());
@@ -2531,11 +2531,11 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools
nMinWdt = nMaxWdt;
}
}
- aPaperMax.Width()=nMaxWdt;
- aPaperMax.Height()=nMaxHgt;
+ aPaperMax.setWidth(nMaxWdt );
+ aPaperMax.setHeight(nMaxHgt );
- aPaperMin.Width()=nMinWdt;
- aPaperMin.Height()=nMinHgt;
+ aPaperMin.setWidth(nMinWdt );
+ aPaperMin.setHeight(nMinHgt );
if ( pViewMin )
{
@@ -2543,30 +2543,30 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools
long nXFree = aAnkSiz.Width() - aPaperMin.Width();
if ( eHAdj == SDRTEXTHORZADJUST_LEFT )
- pViewMin->Right() -= nXFree;
+ pViewMin->AdjustRight( -nXFree );
else if ( eHAdj == SDRTEXTHORZADJUST_RIGHT )
- pViewMin->Left() += nXFree;
- else { pViewMin->Left() += nXFree / 2; pViewMin->Right() = pViewMin->Left() + aPaperMin.Width(); }
+ pViewMin->AdjustLeft(nXFree );
+ else { pViewMin->AdjustLeft(nXFree / 2 ); pViewMin->SetRight( pViewMin->Left() + aPaperMin.Width() ); }
long nYFree = aAnkSiz.Height() - aPaperMin.Height();
if ( eVAdj == SDRTEXTVERTADJUST_TOP )
- pViewMin->Bottom() -= nYFree;
+ pViewMin->AdjustBottom( -nYFree );
else if ( eVAdj == SDRTEXTVERTADJUST_BOTTOM )
- pViewMin->Top() += nYFree;
- else { pViewMin->Top() += nYFree / 2; pViewMin->Bottom() = pViewMin->Top() + aPaperMin.Height(); }
+ pViewMin->AdjustTop(nYFree );
+ else { pViewMin->AdjustTop(nYFree / 2 ); pViewMin->SetBottom( pViewMin->Top() + aPaperMin.Height() ); }
}
if( IsVerticalWriting() )
- aPaperMin.Width() = 0;
+ aPaperMin.setWidth( 0 );
else
- aPaperMin.Height() = 0;
+ aPaperMin.setHeight( 0 );
if( eHAdj != SDRTEXTHORZADJUST_BLOCK )
- aPaperMin.Width()=0;
+ aPaperMin.setWidth(0 );
// For complete vertical adjust support, set paper min height to 0, here.
if(SDRTEXTVERTADJUST_BLOCK != eVAdj )
- aPaperMin.Height() = 0;
+ aPaperMin.setHeight( 0 );
if (pPaperMin!=nullptr) *pPaperMin=aPaperMin;
if (pPaperMax!=nullptr) *pPaperMax=aPaperMax;
@@ -2582,16 +2582,16 @@ void SdrObjCustomShape::TakeTextAnchorRect( tools::Rectangle& rAnchorRect ) cons
if ( GetTextBounds( rAnchorRect ) )
{
Point aRotateRef( maSnapRect.Center() );
- rAnchorRect.Left() += GetTextLeftDistance();
- rAnchorRect.Top() += GetTextUpperDistance();
- rAnchorRect.Right() -= GetTextRightDistance();
- rAnchorRect.Bottom() -= GetTextLowerDistance();
+ rAnchorRect.AdjustLeft(GetTextLeftDistance() );
+ rAnchorRect.AdjustTop(GetTextUpperDistance() );
+ rAnchorRect.AdjustRight( -(GetTextRightDistance()) );
+ rAnchorRect.AdjustBottom( -(GetTextLowerDistance()) );
ImpJustifyRect( rAnchorRect );
if ( rAnchorRect.GetWidth() < 2 )
- rAnchorRect.Right() = rAnchorRect.Left() + 1; // minimal width is 2
+ rAnchorRect.SetRight( rAnchorRect.Left() + 1 ); // minimal width is 2
if ( rAnchorRect.GetHeight() < 2 )
- rAnchorRect.Bottom() = rAnchorRect.Top() + 1; // minimal height is 2
+ rAnchorRect.SetBottom( rAnchorRect.Top() + 1 ); // minimal height is 2
if ( aGeo.nRotationAngle )
{
Point aP( rAnchorRect.TopLeft() );
@@ -2716,17 +2716,17 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle&
{
long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width();
if (eHAdj==SDRTEXTHORZADJUST_CENTER)
- aTextPos.X()+=nFreeWdt/2;
+ aTextPos.AdjustX(nFreeWdt/2 );
if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
- aTextPos.X()+=nFreeWdt;
+ aTextPos.AdjustX(nFreeWdt );
}
if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM)
{
long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height();
if (eVAdj==SDRTEXTVERTADJUST_CENTER)
- aTextPos.Y()+=nFreeHgt/2;
+ aTextPos.AdjustY(nFreeHgt/2 );
if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
- aTextPos.Y()+=nFreeHgt;
+ aTextPos.AdjustY(nFreeHgt );
}
if (aGeo.nRotationAngle!=0)
RotatePoint(aTextPos,aAnkRect.TopLeft(),aGeo.nSin,aGeo.nCos);
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 612f01ab4d1f..f1fcfd8c7f08 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1195,10 +1195,10 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const
bool bRgt=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerRight);
bool bTop=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperLeft);
bool bBtm=(eHdl==SdrHdlKind::LowerRight || eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerLeft);
- if (bLft) aTmpRect.Left() =aPos.X();
- if (bRgt) aTmpRect.Right() =aPos.X();
- if (bTop) aTmpRect.Top() =aPos.Y();
- if (bBtm) aTmpRect.Bottom()=aPos.Y();
+ if (bLft) aTmpRect.SetLeft(aPos.X() );
+ if (bRgt) aTmpRect.SetRight(aPos.X() );
+ if (bTop) aTmpRect.SetTop(aPos.Y() );
+ if (bBtm) aTmpRect.SetBottom(aPos.Y() );
if (bOrtho) { // Ortho
long nWdt0=aRect.Right() -aRect.Left();
long nHgt0=aRect.Bottom()-aRect.Top();
@@ -1223,26 +1223,26 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const
if (bUseX) {
long nNeed=long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
if (bYNeg) nNeed=-nNeed;
- if (bTop) aTmpRect.Top()=aTmpRect.Bottom()-nNeed;
- if (bBtm) aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
+ if (bTop) aTmpRect.SetTop(aTmpRect.Bottom()-nNeed );
+ if (bBtm) aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
} else {
long nNeed=long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
if (bXNeg) nNeed=-nNeed;
- if (bLft) aTmpRect.Left()=aTmpRect.Right()-nNeed;
- if (bRgt) aTmpRect.Right()=aTmpRect.Left()+nNeed;
+ if (bLft) aTmpRect.SetLeft(aTmpRect.Right()-nNeed );
+ if (bRgt) aTmpRect.SetRight(aTmpRect.Left()+nNeed );
}
} else { // apex handles
if ((bLft || bRgt) && nXDiv!=0) {
long nHgt0b=aRect.Bottom()-aRect.Top();
long nNeed=long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
- aTmpRect.Top()-=(nNeed-nHgt0b)/2;
- aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
+ aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
+ aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
}
if ((bTop || bBtm) && nYDiv!=0) {
long nWdt0b=aRect.Right()-aRect.Left();
long nNeed=long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
- aTmpRect.Left()-=(nNeed-nWdt0b)/2;
- aTmpRect.Right()=aTmpRect.Left()+nNeed;
+ aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
+ aTmpRect.SetRight(aTmpRect.Left()+nNeed );
}
}
}
@@ -1371,12 +1371,12 @@ void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
Point aRef2(aRef1);
- aRef2.Y()++;
+ aRef2.AdjustY( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
if (bYMirr) {
Point aRef2(aRef1);
- aRef2.X()++;
+ aRef2.AdjustX( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
}
@@ -1390,20 +1390,20 @@ void SdrObject::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
aOutRect.Move(-rRef.X(),-rRef.Y());
tools::Rectangle R(aOutRect);
if (sn==1.0 && cs==0.0) { // 90deg
- aOutRect.Left() =-R.Bottom();
- aOutRect.Right() =-R.Top();
- aOutRect.Top() =R.Left();
- aOutRect.Bottom()=R.Right();
+ aOutRect.SetLeft(-R.Bottom() );
+ aOutRect.SetRight(-R.Top() );
+ aOutRect.SetTop(R.Left() );
+ aOutRect.SetBottom(R.Right() );
} else if (sn==0.0 && cs==-1.0) { // 180deg
- aOutRect.Left() =-R.Right();
- aOutRect.Right() =-R.Left();
- aOutRect.Top() =-R.Bottom();
- aOutRect.Bottom()=-R.Top();
+ aOutRect.SetLeft(-R.Right() );
+ aOutRect.SetRight(-R.Left() );
+ aOutRect.SetTop(-R.Bottom() );
+ aOutRect.SetBottom(-R.Top() );
} else if (sn==-1.0 && cs==0.0) { // 270deg
- aOutRect.Left() =R.Top();
- aOutRect.Right() =R.Bottom();
- aOutRect.Top() =-R.Right();
- aOutRect.Bottom()=-R.Left();
+ aOutRect.SetLeft(R.Top() );
+ aOutRect.SetRight(R.Bottom() );
+ aOutRect.SetTop(-R.Right() );
+ aOutRect.SetBottom(-R.Left() );
}
aOutRect.Move(rRef.X(),rRef.Y());
aOutRect.Justify(); // just in case
@@ -1420,21 +1420,21 @@ void SdrObject::NbcMirror(const Point& rRef1, const Point& rRef2)
long dx=rRef2.X()-rRef1.X();
long dy=rRef2.Y()-rRef1.Y();
if (dx==0) { // vertical axis
- aOutRect.Left() =-R.Right();
- aOutRect.Right()=-R.Left();
+ aOutRect.SetLeft(-R.Right() );
+ aOutRect.SetRight(-R.Left() );
} else if (dy==0) { // horizontal axis
- aOutRect.Top() =-R.Bottom();
- aOutRect.Bottom()=-R.Top();
+ aOutRect.SetTop(-R.Bottom() );
+ aOutRect.SetBottom(-R.Top() );
} else if (dx==dy) { // 45deg axis
- aOutRect.Left() =R.Top();
- aOutRect.Right() =R.Bottom();
- aOutRect.Top() =R.Left();
- aOutRect.Bottom()=R.Right();
+ aOutRect.SetLeft(R.Top() );
+ aOutRect.SetRight(R.Bottom() );
+ aOutRect.SetTop(R.Left() );
+ aOutRect.SetBottom(R.Right() );
} else if (dx==-dy) { // 45deg axis
- aOutRect.Left() =-R.Bottom();
- aOutRect.Right() =-R.Top();
- aOutRect.Top() =-R.Right();
- aOutRect.Bottom()=-R.Left();
+ aOutRect.SetLeft(-R.Bottom() );
+ aOutRect.SetRight(-R.Top() );
+ aOutRect.SetTop(-R.Right() );
+ aOutRect.SetBottom(-R.Left() );
}
aOutRect.Move(rRef1.X(),rRef1.Y());
aOutRect.Justify(); // just in case
@@ -1953,19 +1953,19 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
const tools::Rectangle& rSnap=GetSnapRect();
const tools::Rectangle& rLogic=GetLogicRect();
Point aRef1(rSnap.Center());
- Point aRef2(aRef1); aRef2.Y()++;
+ Point aRef2(aRef1); aRef2.AdjustY( 1 );
const SfxPoolItem *pPoolItem=nullptr;
if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) {
- aRef1.X()=static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue();
+ aRef1.setX(static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue() );
}
if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) {
- aRef1.Y()=static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue();
+ aRef1.setY(static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue() );
}
if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) {
- aRef2.X()=static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue();
+ aRef2.setX(static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue() );
}
if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) {
- aRef2.Y()=static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue();
+ aRef2.setY(static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue() );
}
tools::Rectangle aNewSnap(rSnap);
@@ -1987,11 +1987,11 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
}
if (rAttr.GetItemState(SDRATTR_ONESIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) {
long n=static_cast<const SdrOneSizeWidthItem*>(pPoolItem)->GetValue();
- aNewSnap.Right()=aNewSnap.Left()+n;
+ aNewSnap.SetRight(aNewSnap.Left()+n );
}
if (rAttr.GetItemState(SDRATTR_ONESIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) {
long n=static_cast<const SdrOneSizeHeightItem*>(pPoolItem)->GetValue();
- aNewSnap.Bottom()=aNewSnap.Top()+n;
+ aNewSnap.SetBottom(aNewSnap.Top()+n );
}
if (aNewSnap!=rSnap) {
if (aNewSnap.GetSize()==rSnap.GetSize()) {
@@ -2084,11 +2084,11 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
tools::Rectangle aNewLogic(rLogic);
if (rAttr.GetItemState(SDRATTR_LOGICSIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) {
long n=static_cast<const SdrLogicSizeWidthItem*>(pPoolItem)->GetValue();
- aNewLogic.Right()=aNewLogic.Left()+n;
+ aNewLogic.SetRight(aNewLogic.Left()+n );
}
if (rAttr.GetItemState(SDRATTR_LOGICSIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) {
long n=static_cast<const SdrLogicSizeHeightItem*>(pPoolItem)->GetValue();
- aNewLogic.Bottom()=aNewLogic.Top()+n;
+ aNewLogic.SetBottom(aNewLogic.Top()+n );
}
if (aNewLogic!=rLogic) {
NbcSetLogicRect(aNewLogic);
@@ -2142,7 +2142,7 @@ void SdrObject::TakeNotPersistAttr(SfxItemSet& rAttr) const
}
}
Point aRef1(rSnap.Center());
- Point aRef2(aRef1); aRef2.Y()++;
+ Point aRef2(aRef1); aRef2.AdjustY( 1 );
rAttr.Put(SdrTransformRef1XItem(aRef1.X()));
rAttr.Put(SdrTransformRef1YItem(aRef1.Y()));
rAttr.Put(SdrTransformRef2XItem(aRef2.X()));
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 4a7b3bd878f9..00cb7ded37ab 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -461,11 +461,11 @@ void SdrCaptionObj::ImpCalcTail1(const ImpCaptParams& rPara, tools::Polygon& rPo
if(eEscDir==LKS || eEscDir==RTS)
{
- aPol[0].X() = aEscPos.X();
+ aPol[0].setX( aEscPos.X() );
}
else
{
- aPol[0].Y() = aEscPos.Y();
+ aPol[0].setY( aEscPos.Y() );
}
rPoly = aPol;
@@ -502,17 +502,17 @@ void SdrCaptionObj::ImpCalcTail3(const ImpCaptParams& rPara, tools::Polygon& rPo
if (eEscDir==LKS || eEscDir==RTS) {
if (rPara.bFitLineLen) {
- aPol[1].X()=(aTl.X()+aEscPos.X())/2;
+ aPol[1].setX((aTl.X()+aEscPos.X())/2 );
} else {
- if (eEscDir==LKS) aPol[1].X()-=rPara.nLineLen;
- else aPol[1].X()+=rPara.nLineLen;
+ if (eEscDir==LKS) aPol[1].AdjustX( -(rPara.nLineLen) );
+ else aPol[1].AdjustX(rPara.nLineLen );
}
} else {
if (rPara.bFitLineLen) {
- aPol[1].Y()=(aTl.Y()+aEscPos.Y())/2;
+ aPol[1].setY((aTl.Y()+aEscPos.Y())/2 );
} else {
- if (eEscDir==OBN) aPol[1].Y()-=rPara.nLineLen;
- else aPol[1].Y()+=rPara.nLineLen;
+ if (eEscDir==OBN) aPol[1].AdjustY( -(rPara.nLineLen) );
+ else aPol[1].AdjustY(rPara.nLineLen );
}
}
if (!rPara.bFixedAngle) {
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 61b050d39fe2..78dd14899b20 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -61,25 +61,25 @@ Point GetAnglePnt(const tools::Rectangle& rR, long nAngle)
double a;
a=nAngle*nPi180;
Point aRetval(svx::Round(cos(a)*nMaxRad),-svx::Round(sin(a)*nMaxRad));
- if (nWdt==0) aRetval.X()=0;
- if (nHgt==0) aRetval.Y()=0;
+ if (nWdt==0) aRetval.setX(0 );
+ if (nHgt==0) aRetval.setY(0 );
if (nWdt!=nHgt) {
if (nWdt>nHgt) {
if (nWdt!=0) {
// stop possible overruns for very large objects
if (std::abs(nHgt)>32767 || std::abs(aRetval.Y())>32767) {
- aRetval.Y()=BigMulDiv(aRetval.Y(),nHgt,nWdt);
+ aRetval.setY(BigMulDiv(aRetval.Y(),nHgt,nWdt) );
} else {
- aRetval.Y()=aRetval.Y()*nHgt/nWdt;
+ aRetval.setY(aRetval.Y()*nHgt/nWdt );
}
}
} else {
if (nHgt!=0) {
// stop possible overruns for very large objects
if (std::abs(nWdt)>32767 || std::abs(aRetval.X())>32767) {
- aRetval.X()=BigMulDiv(aRetval.X(),nWdt,nHgt);
+ aRetval.setX(BigMulDiv(aRetval.X(),nWdt,nHgt) );
} else {
- aRetval.X()=aRetval.X()*nWdt/nHgt;
+ aRetval.setX(aRetval.X()*nWdt/nHgt );
}
}
}
@@ -505,11 +505,11 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag)
if(nWdt>=nHgt)
{
- aPt.Y()=BigMulDiv(aPt.Y(),nWdt,nHgt);
+ aPt.setY(BigMulDiv(aPt.Y(),nWdt,nHgt) );
}
else
{
- aPt.X()=BigMulDiv(aPt.X(),nHgt,nWdt);
+ aPt.setX(BigMulDiv(aPt.X(),nHgt,nWdt) );
}
long nAngle=NormAngle360(GetAngle(aPt));
@@ -618,12 +618,12 @@ void ImpCircUser::SetCreateParams(SdrDragStat const & rStat)
nEnd=36000;
if (rStat.GetPointCount()>2) {
Point aP(rStat.GetPoint(2)-aCenter);
- if (nWdt==0) aP.X()=0;
- if (nHgt==0) aP.Y()=0;
+ if (nWdt==0) aP.setX(0 );
+ if (nHgt==0) aP.setY(0 );
if (nWdt>=nHgt) {
- if (nHgt!=0) aP.Y()=aP.Y()*nWdt/nHgt;
+ if (nHgt!=0) aP.setY(aP.Y()*nWdt/nHgt );
} else {
- if (nWdt!=0) aP.X()=aP.X()*nHgt/nWdt;
+ if (nWdt!=0) aP.setX(aP.X()*nHgt/nWdt );
}
nStart=NormAngle360(GetAngle(aP));
if (rStat.GetView()!=nullptr && rStat.GetView()->IsAngleSnapEnabled()) {
@@ -642,9 +642,9 @@ void ImpCircUser::SetCreateParams(SdrDragStat const & rStat)
if (rStat.GetPointCount()>3) {
Point aP(rStat.GetPoint(3)-aCenter);
if (nWdt>=nHgt) {
- aP.Y()=BigMulDiv(aP.Y(),nWdt,nHgt);
+ aP.setY(BigMulDiv(aP.Y(),nWdt,nHgt) );
} else {
- aP.X()=BigMulDiv(aP.X(),nHgt,nWdt);
+ aP.setX(BigMulDiv(aP.X(),nHgt,nWdt) );
}
nEnd=NormAngle360(GetAngle(aP));
if (rStat.GetView()!=nullptr && rStat.GetView()->IsAngleSnapEnabled()) {
@@ -868,14 +868,14 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
// starting point
a=nStartAngle*nPi180;
aTmpPt1=Point(svx::Round(cos(a)*nMaxRad),-svx::Round(sin(a)*nMaxRad));
- if (nWdt==0) aTmpPt1.X()=0;
- if (nHgt==0) aTmpPt1.Y()=0;
+ if (nWdt==0) aTmpPt1.setX(0 );
+ if (nHgt==0) aTmpPt1.setY(0 );
aTmpPt1+=aCenter;
// finishing point
a=nEndAngle*nPi180;
aTmpPt2=Point(svx::Round(cos(a)*nMaxRad),-svx::Round(sin(a)*nMaxRad));
- if (nWdt==0) aTmpPt2.X()=0;
- if (nHgt==0) aTmpPt2.Y()=0;
+ if (nWdt==0) aTmpPt2.setX(0 );
+ if (nHgt==0) aTmpPt2.setY(0 );
aTmpPt2+=aCenter;
if (aGeo.nRotationAngle!=0) {
RotatePoint(aTmpPt1,maRect.TopLeft(),aGeo.nSin,aGeo.nCos);
@@ -940,10 +940,10 @@ void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo)
void Union(tools::Rectangle& rR, const Point& rP)
{
- if (rP.X()<rR.Left ()) rR.Left ()=rP.X();
- if (rP.X()>rR.Right ()) rR.Right ()=rP.X();
- if (rP.Y()<rR.Top ()) rR.Top ()=rP.Y();
- if (rP.Y()>rR.Bottom()) rR.Bottom()=rP.Y();
+ if (rP.X()<rR.Left ()) rR.SetLeft(rP.X() );
+ if (rP.X()>rR.Right ()) rR.SetRight(rP.X() );
+ if (rP.Y()<rR.Top ()) rR.SetTop(rP.Y() );
+ if (rP.Y()>rR.Bottom()) rR.SetBottom(rP.Y() );
}
void SdrCircObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
@@ -954,10 +954,10 @@ void SdrCircObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
const Point aPntEnd(GetAnglePnt(maRect,nEndAngle));
long a=nStartAngle;
long e=nEndAngle;
- rRect.Left ()=maRect.Right();
- rRect.Right ()=maRect.Left();
- rRect.Top ()=maRect.Bottom();
- rRect.Bottom()=maRect.Top();
+ rRect.SetLeft(maRect.Right() );
+ rRect.SetRight(maRect.Left() );
+ rRect.SetTop(maRect.Bottom() );
+ rRect.SetBottom(maRect.Top() );
Union(rRect,aPntStart);
Union(rRect,aPntEnd);
if ((a<=18000 && e>=18000) || (a>e && (a<=18000 || e>=18000))) {
@@ -988,13 +988,13 @@ void SdrCircObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
long nDst=svx::Round((rRect.Bottom()-rRect.Top())*aGeo.nTan);
if (aGeo.nShearAngle>0) {
Point aRef(rRect.TopLeft());
- rRect.Left()-=nDst;
+ rRect.AdjustLeft( -nDst );
Point aTmpPt(rRect.TopLeft());
RotatePoint(aTmpPt,aRef,aGeo.nSin,aGeo.nCos);
aTmpPt-=rRect.TopLeft();
rRect.Move(aTmpPt.X(),aTmpPt.Y());
} else {
- rRect.Right()-=nDst;
+ rRect.AdjustRight( -nDst );
}
}
}
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index f0fdf4e06730..7aeb6bf17a04 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -131,8 +131,8 @@ bool SdrEdgeInfoRec::ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rX
void SdrEdgeInfoRec::ImpSetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal)
{
Point& rPt=ImpGetLineOffsetPoint(eLineCode);
- if (ImpIsHorzLine(eLineCode,rXP)) rPt.Y()=nVal;
- else rPt.X()=nVal;
+ if (ImpIsHorzLine(eLineCode,rXP)) rPt.setY(nVal );
+ else rPt.setX(nVal );
}
long SdrEdgeInfoRec::ImpGetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const
@@ -232,20 +232,20 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo()
if(bHor1)
{
- aEdgeInfo.aObj1Line2.X() = nVal1;
+ aEdgeInfo.aObj1Line2.setX( nVal1 );
}
else
{
- aEdgeInfo.aObj1Line2.Y() = nVal1;
+ aEdgeInfo.aObj1Line2.setY( nVal1 );
}
if(bHor2)
{
- aEdgeInfo.aObj2Line2.X() = nVal2;
+ aEdgeInfo.aObj2Line2.setX( nVal2 );
}
else
{
- aEdgeInfo.aObj2Line2.Y() = nVal2;
+ aEdgeInfo.aObj2Line2.setY( nVal2 );
}
}
@@ -418,8 +418,8 @@ SdrGluePoint SdrEdgeObj::GetVertexGluePoint(sal_uInt16 nNum) const
Point aPt1((*pEdgeTrack)[nPointCount/2-1]);
Point aPt2((*pEdgeTrack)[nPointCount/2]);
aPt1+=aPt2;
- aPt1.X()/=2;
- aPt1.Y()/=2;
+ aPt1.setX( aPt1.X() / 2 );
+ aPt1.setY( aPt1.Y() / 2 );
aPt=aPt1;
}
}
@@ -643,44 +643,44 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons
bool bUnt=nEscAngle==27000;
Point aP1(rStPt); // mandatory difference first,...
- if (bLks) aP1.X()=rRect.Left();
- if (bRts) aP1.X()=rRect.Right();
- if (bObn) aP1.Y()=rRect.Top();
- if (bUnt) aP1.Y()=rRect.Bottom();
+ if (bLks) aP1.setX(rRect.Left() );
+ if (bRts) aP1.setX(rRect.Right() );
+ if (bObn) aP1.setY(rRect.Top() );
+ if (bUnt) aP1.setY(rRect.Bottom() );
Point aP2(aP1); // ...now increase to Meeting height, if necessary
- if (bLks && rMeeting.X()<=aP2.X()) aP2.X()=rMeeting.X();
- if (bRts && rMeeting.X()>=aP2.X()) aP2.X()=rMeeting.X();
- if (bObn && rMeeting.Y()<=aP2.Y()) aP2.Y()=rMeeting.Y();
- if (bUnt && rMeeting.Y()>=aP2.Y()) aP2.Y()=rMeeting.Y();
+ if (bLks && rMeeting.X()<=aP2.X()) aP2.setX(rMeeting.X() );
+ if (bRts && rMeeting.X()>=aP2.X()) aP2.setX(rMeeting.X() );
+ if (bObn && rMeeting.Y()<=aP2.Y()) aP2.setY(rMeeting.Y() );
+ if (bUnt && rMeeting.Y()>=aP2.Y()) aP2.setY(rMeeting.Y() );
aXP.Insert(XPOLY_APPEND,aP2,PolyFlags::Normal);
Point aP3(aP2);
if ((bLks && rMeeting.X()>aP2.X()) || (bRts && rMeeting.X()<aP2.X())) { // around
if (rMeeting.Y()<aP2.Y()) {
- aP3.Y()=rRect.Top();
- if (rMeeting.Y()<aP3.Y()) aP3.Y()=rMeeting.Y();
+ aP3.setY(rRect.Top() );
+ if (rMeeting.Y()<aP3.Y()) aP3.setY(rMeeting.Y() );
} else {
- aP3.Y()=rRect.Bottom();
- if (rMeeting.Y()>aP3.Y()) aP3.Y()=rMeeting.Y();
+ aP3.setY(rRect.Bottom() );
+ if (rMeeting.Y()>aP3.Y()) aP3.setY(rMeeting.Y() );
}
aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal);
if (aP3.Y()!=rMeeting.Y()) {
- aP3.X()=rMeeting.X();
+ aP3.setX(rMeeting.X() );
aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal);
}
}
if ((bObn && rMeeting.Y()>aP2.Y()) || (bUnt && rMeeting.Y()<aP2.Y())) { // around
if (rMeeting.X()<aP2.X()) {
- aP3.X()=rRect.Left();
- if (rMeeting.X()<aP3.X()) aP3.X()=rMeeting.X();
+ aP3.setX(rRect.Left() );
+ if (rMeeting.X()<aP3.X()) aP3.setX(rMeeting.X() );
} else {
- aP3.X()=rRect.Right();
- if (rMeeting.X()>aP3.X()) aP3.X()=rMeeting.X();
+ aP3.setX(rRect.Right() );
+ if (rMeeting.X()>aP3.X()) aP3.setX(rMeeting.X() );
}
aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal);
if (aP3.X()!=rMeeting.X()) {
- aP3.Y()=rMeeting.Y();
+ aP3.setY(rMeeting.Y() );
aXP.Insert(XPOLY_APPEND,aP3,PolyFlags::Normal);
}
}
@@ -736,10 +736,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection&
sal_Int32 nH = rSet.Get(SDRATTR_EDGENODE1HORZDIST).GetValue();
sal_Int32 nV = rSet.Get(SDRATTR_EDGENODE1VERTDIST).GetValue();
- aBewareRect1.Left()-=nH;
- aBewareRect1.Right()+=nH;
- aBewareRect1.Top()-=nV;
- aBewareRect1.Bottom()+=nV;
+ aBewareRect1.AdjustLeft( -nH );
+ aBewareRect1.AdjustRight(nH );
+ aBewareRect1.AdjustTop( -nV );
+ aBewareRect1.AdjustBottom(nV );
} else {
aBoundRect1=tools::Rectangle(aPt1,aPt1);
aBoundRect1.Move(rCon1.aObjOfs.X(),rCon1.aObjOfs.Y());
@@ -759,10 +759,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection&
sal_Int32 nH = rSet.Get(SDRATTR_EDGENODE2HORZDIST).GetValue();
sal_Int32 nV = rSet.Get(SDRATTR_EDGENODE2VERTDIST).GetValue();
- aBewareRect2.Left()-=nH;
- aBewareRect2.Right()+=nH;
- aBewareRect2.Top()-=nV;
- aBewareRect2.Bottom()+=nV;
+ aBewareRect2.AdjustLeft( -nH );
+ aBewareRect2.AdjustRight(nH );
+ aBewareRect2.AdjustTop( -nV );
+ aBewareRect2.AdjustBottom(nV );
} else {
aBoundRect2=tools::Rectangle(aPt2,aPt2);
aBoundRect2.Move(rCon2.aObjOfs.X(),rCon2.aObjOfs.Y());
@@ -866,14 +866,14 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
aXP[1]=rPt1;
aXP[2]=rPt2;
aXP[3]=rPt2;
- if (bRts1) aXP[1].X()=aBewareRect1.Right(); //+=500;
- if (bObn1) aXP[1].Y()=aBewareRect1.Top(); //-=500;
- if (bLks1) aXP[1].X()=aBewareRect1.Left(); //-=500;
- if (bUnt1) aXP[1].Y()=aBewareRect1.Bottom(); //+=500;
- if (bRts2) aXP[2].X()=aBewareRect2.Right(); //+=500;
- if (bObn2) aXP[2].Y()=aBewareRect2.Top(); //-=500;
- if (bLks2) aXP[2].X()=aBewareRect2.Left(); //-=500;
- if (bUnt2) aXP[2].Y()=aBewareRect2.Bottom(); //+=500;
+ if (bRts1) aXP[1].setX(aBewareRect1.Right() ); //+=500;
+ if (bObn1) aXP[1].setY(aBewareRect1.Top() ); //-=500;
+ if (bLks1) aXP[1].setX(aBewareRect1.Left() ); //-=500;
+ if (bUnt1) aXP[1].setY(aBewareRect1.Bottom() ); //+=500;
+ if (bRts2) aXP[2].setX(aBewareRect2.Right() ); //+=500;
+ if (bObn2) aXP[2].setY(aBewareRect2.Top() ); //-=500;
+ if (bLks2) aXP[2].setX(aBewareRect2.Left() ); //-=500;
+ if (bUnt2) aXP[2].setY(aBewareRect2.Bottom() ); //+=500;
if (pnQuality!=nullptr) {
long nQ=std::abs(aXP[1].X()-aXP[0].X())+std::abs(aXP[1].Y()-aXP[0].Y());
nQ+=std::abs(aXP[2].X()-aXP[1].X())+std::abs(aXP[2].Y()-aXP[1].Y());
@@ -884,14 +884,14 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
pInfo->nObj1Lines=2;
pInfo->nObj2Lines=2;
if (bHor1) {
- aXP[1].X()+=pInfo->aObj1Line2.X();
+ aXP[1].AdjustX(pInfo->aObj1Line2.X() );
} else {
- aXP[1].Y()+=pInfo->aObj1Line2.Y();
+ aXP[1].AdjustY(pInfo->aObj1Line2.Y() );
}
if (bHor2) {
- aXP[2].X()+=pInfo->aObj2Line2.X();
+ aXP[2].AdjustX(pInfo->aObj2Line2.X() );
} else {
- aXP[2].Y()+=pInfo->aObj2Line2.Y();
+ aXP[2].AdjustY(pInfo->aObj2Line2.Y() );
}
}
return aXP;
@@ -904,26 +904,26 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
// overlapping on the x axis
long n1=std::max(aBewareRect1.Left(),aBewareRect2.Left());
long n2=std::min(aBewareRect1.Right(),aBewareRect2.Right());
- aMeeting.X()=(n1+n2+1)/2;
+ aMeeting.setX((n1+n2+1)/2 );
} else {
// otherwise the center point of the empty space
if (aC1.X()<aC2.X()) {
- aMeeting.X()=(aBewareRect1.Right()+aBewareRect2.Left()+1)/2;
+ aMeeting.setX((aBewareRect1.Right()+aBewareRect2.Left()+1)/2 );
} else {
- aMeeting.X()=(aBewareRect1.Left()+aBewareRect2.Right()+1)/2;
+ aMeeting.setX((aBewareRect1.Left()+aBewareRect2.Right()+1)/2 );
}
}
if (aBewareRect1.Top()<=aBewareRect2.Bottom() && aBewareRect1.Bottom()>=aBewareRect2.Top()) {
// overlapping on the x axis
long n1=std::max(aBewareRect1.Top(),aBewareRect2.Top());
long n2=std::min(aBewareRect1.Bottom(),aBewareRect2.Bottom());
- aMeeting.Y()=(n1+n2+1)/2;
+ aMeeting.setY((n1+n2+1)/2 );
} else {
// otherwise the center point of the empty space
if (aC1.Y()<aC2.Y()) {
- aMeeting.Y()=(aBewareRect1.Bottom()+aBewareRect2.Top()+1)/2;
+ aMeeting.setY((aBewareRect1.Bottom()+aBewareRect2.Top()+1)/2 );
} else {
- aMeeting.Y()=(aBewareRect1.Top()+aBewareRect2.Bottom()+1)/2;
+ aMeeting.setY((aBewareRect1.Top()+aBewareRect2.Bottom()+1)/2 );
}
}
// Here, there are three cases:
@@ -940,24 +940,24 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
if (nAngle1==nAngle2) nMainCase=1;
else if ((bHor1 && bHor2) || (bVer1 && bVer2)) nMainCase=2;
if (nMainCase==1) { // case 1 (both go in one direction) is possible
- if (bVer1) aMeeting.X()=(aPt1.X()+aPt2.X()+1)/2; // Here, this is better than
- if (bHor1) aMeeting.Y()=(aPt1.Y()+aPt2.Y()+1)/2; // using center point of empty space
+ if (bVer1) aMeeting.setX((aPt1.X()+aPt2.X()+1)/2 ); // Here, this is better than
+ if (bHor1) aMeeting.setY((aPt1.Y()+aPt2.Y()+1)/2 ); // using center point of empty space
// bX1Ok means that the vertical exiting Obj1 doesn't conflict with Obj2, ...
bool bX1Ok=aPt1.X()<=aBewareRect2.Left() || aPt1.X()>=aBewareRect2.Right();
bool bX2Ok=aPt2.X()<=aBewareRect1.Left() || aPt2.X()>=aBewareRect1.Right();
bool bY1Ok=aPt1.Y()<=aBewareRect2.Top() || aPt1.Y()>=aBewareRect2.Bottom();
bool bY2Ok=aPt2.Y()<=aBewareRect1.Top() || aPt2.Y()>=aBewareRect1.Bottom();
if (bLks1 && (bY1Ok || aBewareRect1.Left()<aBewareRect2.Right()) && (bY2Ok || aBewareRect2.Left()<aBewareRect1.Right())) {
- aMeeting.X()=nXMin;
+ aMeeting.setX(nXMin );
}
if (bRts1 && (bY1Ok || aBewareRect1.Right()>aBewareRect2.Left()) && (bY2Ok || aBewareRect2.Right()>aBewareRect1.Left())) {
- aMeeting.X()=nXMax;
+ aMeeting.setX(nXMax );
}
if (bObn1 && (bX1Ok || aBewareRect1.Top()<aBewareRect2.Bottom()) && (bX2Ok || aBewareRect2.Top()<aBewareRect1.Bottom())) {
- aMeeting.Y()=nYMin;
+ aMeeting.setY(nYMin );
}
if (bUnt1 && (bX1Ok || aBewareRect1.Bottom()>aBewareRect2.Top()) && (bX2Ok || aBewareRect2.Bottom()>aBewareRect1.Top())) {
- aMeeting.Y()=nYMax;
+ aMeeting.setY(nYMax );
}
} else if (nMainCase==2) {
// case 2:
@@ -1031,17 +1031,17 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
if (!bCase29Direct) {
bool bObenLang=std::abs(nYMin-aMeeting.Y())<=std::abs(nYMax-aMeeting.Y());
if (bObenLang) {
- aMeeting.Y()=nYMin;
+ aMeeting.setY(nYMin );
} else {
- aMeeting.Y()=nYMax;
+ aMeeting.setY(nYMax );
}
if (bCase29) {
// now make sure that the surrounded object
// isn't traversed
if ((aBewR1.Center().Y()<aBewR2.Center().Y()) != bObenLang) {
- aMeeting.X()=aBewR2.Right();
+ aMeeting.setX(aBewR2.Right() );
} else {
- aMeeting.X()=aBewR1.Left();
+ aMeeting.setX(aBewR1.Left() );
}
}
} else {
@@ -1054,11 +1054,11 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
long nGet1=BigMulDiv(nWant1,nSpace,nWant1+nWant2);
long nGet2=nSpace-nGet1;
if (bRts1) { // revert normalization
- aBewareRect1.Right()+=nGet1-nWant1;
- aBewareRect2.Left()-=nGet2-nWant2;
+ aBewareRect1.AdjustRight(nGet1-nWant1 );
+ aBewareRect2.AdjustLeft( -(nGet2-nWant2) );
} else {
- aBewareRect2.Right()+=nGet1-nWant1;
- aBewareRect1.Left()-=nGet2-nWant2;
+ aBewareRect2.AdjustRight(nGet1-nWant1 );
+ aBewareRect1.AdjustLeft( -(nGet2-nWant2) );
}
nIntersections++; // lower quality
}
@@ -1092,17 +1092,17 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
if (!bCase29Direct) {
bool bLinksLang=std::abs(nXMin-aMeeting.X())<=std::abs(nXMax-aMeeting.X());
if (bLinksLang) {
- aMeeting.X()=nXMin;
+ aMeeting.setX(nXMin );
} else {
- aMeeting.X()=nXMax;
+ aMeeting.setX(nXMax );
}
if (bCase29) {
// now make sure that the surrounded object
// isn't traversed
if ((aBewR1.Center().X()<aBewR2.Center().X()) != bLinksLang) {
- aMeeting.Y()=aBewR2.Bottom();
+ aMeeting.setY(aBewR2.Bottom() );
} else {
- aMeeting.Y()=aBewR1.Top();
+ aMeeting.setY(aBewR1.Top() );
}
}
} else {
@@ -1115,11 +1115,11 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
long nGet1=BigMulDiv(nWant1,nSpace,nWant1+nWant2);
long nGet2=nSpace-nGet1;
if (bUnt1) { // revert normalization
- aBewareRect1.Bottom()+=nGet1-nWant1;
- aBewareRect2.Top()-=nGet2-nWant2;
+ aBewareRect1.AdjustBottom(nGet1-nWant1 );
+ aBewareRect2.AdjustTop( -(nGet2-nWant2) );
} else {
- aBewareRect2.Bottom()+=nGet1-nWant1;
- aBewareRect1.Top()-=nGet2-nWant2;
+ aBewareRect2.AdjustBottom(nGet1-nWant1 );
+ aBewareRect1.AdjustTop( -(nGet2-nWant2) );
}
nIntersections++; // lower quality
}
@@ -1189,11 +1189,11 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
((bUnt1 && aTmpR1.Bottom()<=aPt2.Y()) || (bObn1 && aTmpR1.Top ()>=aPt2.Y())))) {
// case 3.2 applies: connector with only 2 lines
if (bHor1) {
- aMeeting.X()=aPt2.X();
- aMeeting.Y()=aPt1.Y();
+ aMeeting.setX(aPt2.X() );
+ aMeeting.setY(aPt1.Y() );
} else {
- aMeeting.X()=aPt1.X();
- aMeeting.Y()=aPt2.Y();
+ aMeeting.setX(aPt1.X() );
+ aMeeting.setY(aPt2.Y() );
}
// in the case of overlapping BewareRects:
aBewareRect1=aTmpR1;
@@ -1207,10 +1207,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
((bUnt1 && aBewareRect1.Bottom()>aBewareRect2.Top ()) ||
(bObn1 && aBewareRect1.Top ()<aBewareRect2.Bottom())))) {
// case 3.3
- if (bRts1 || bRts2) { aMeeting.X()=nXMax; }
- if (bLks1 || bLks2) { aMeeting.X()=nXMin; }
- if (bUnt1 || bUnt2) { aMeeting.Y()=nYMax; }
- if (bObn1 || bObn2) { aMeeting.Y()=nYMin; }
+ if (bRts1 || bRts2) { aMeeting.setX(nXMax ); }
+ if (bLks1 || bLks2) { aMeeting.setX(nXMin ); }
+ if (bUnt1 || bUnt2) { aMeeting.setY(nYMax ); }
+ if (bObn1 || bObn2) { aMeeting.setY(nYMin ); }
}
}
}
@@ -1405,51 +1405,51 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
if (pInfo->nMiddleLine!=0xFFFF) {
sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(SdrEdgeLineCode::MiddleLine,aXP1);
if (pInfo->ImpIsHorzLine(SdrEdgeLineCode::MiddleLine,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aMiddleLine.Y();
- aXP1[nIdx+1].Y()+=pInfo->aMiddleLine.Y();
+ aXP1[nIdx].AdjustY(pInfo->aMiddleLine.Y() );
+ aXP1[nIdx+1].AdjustY(pInfo->aMiddleLine.Y() );
} else {
- aXP1[nIdx].X()+=pInfo->aMiddleLine.X();
- aXP1[nIdx+1].X()+=pInfo->aMiddleLine.X();
+ aXP1[nIdx].AdjustX(pInfo->aMiddleLine.X() );
+ aXP1[nIdx+1].AdjustX(pInfo->aMiddleLine.X() );
}
}
if (pInfo->nObj1Lines>=2) {
sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(SdrEdgeLineCode::Obj1Line2,aXP1);
if (pInfo->ImpIsHorzLine(SdrEdgeLineCode::Obj1Line2,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj1Line2.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj1Line2.Y();
+ aXP1[nIdx].AdjustY(pInfo->aObj1Line2.Y() );
+ aXP1[nIdx+1].AdjustY(pInfo->aObj1Line2.Y() );
} else {
- aXP1[nIdx].X()+=pInfo->aObj1Line2.X();
- aXP1[nIdx+1].X()+=pInfo->aObj1Line2.X();
+ aXP1[nIdx].AdjustX(pInfo->aObj1Line2.X() );
+ aXP1[nIdx+1].AdjustX(pInfo->aObj1Line2.X() );
}
}
if (pInfo->nObj1Lines>=3) {
sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(SdrEdgeLineCode::Obj1Line3,aXP1);
if (pInfo->ImpIsHorzLine(SdrEdgeLineCode::Obj1Line3,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj1Line3.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj1Line3.Y();
+ aXP1[nIdx].AdjustY(pInfo->aObj1Line3.Y() );
+ aXP1[nIdx+1].AdjustY(pInfo->aObj1Line3.Y() );
} else {
- aXP1[nIdx].X()+=pInfo->aObj1Line3.X();
- aXP1[nIdx+1].X()+=pInfo->aObj1Line3.X();
+ aXP1[nIdx].AdjustX(pInfo->aObj1Line3.X() );
+ aXP1[nIdx+1].AdjustX(pInfo->aObj1Line3.X() );
}
}
if (pInfo->nObj2Lines>=2) {
sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(SdrEdgeLineCode::Obj2Line2,aXP1);
if (pInfo->ImpIsHorzLine(SdrEdgeLineCode::Obj2Line2,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj2Line2.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj2Line2.Y();
+ aXP1[nIdx].AdjustY(pInfo->aObj2Line2.Y() );
+ aXP1[nIdx+1].AdjustY(pInfo->aObj2Line2.Y() );
} else {
- aXP1[nIdx].X()+=pInfo->aObj2Line2.X();
- aXP1[nIdx+1].X()+=pInfo->aObj2Line2.X();
+ aXP1[nIdx].AdjustX(pInfo->aObj2Line2.X() );
+ aXP1[nIdx+1].AdjustX(pInfo->aObj2Line2.X() );
}
}
if (pInfo->nObj2Lines>=3) {
sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(SdrEdgeLineCode::Obj2Line3,aXP1);
if (pInfo->ImpIsHorzLine(SdrEdgeLineCode::Obj2Line3,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj2Line3.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj2Line3.Y();
+ aXP1[nIdx].AdjustY(pInfo->aObj2Line3.Y() );
+ aXP1[nIdx+1].AdjustY(pInfo->aObj2Line3.Y() );
} else {
- aXP1[nIdx].X()+=pInfo->aObj2Line3.X();
- aXP1[nIdx+1].X()+=pInfo->aObj2Line3.X();
+ aXP1[nIdx].AdjustX(pInfo->aObj2Line3.X() );
+ aXP1[nIdx+1].AdjustX(pInfo->aObj2Line3.X() );
}
}
}
@@ -1470,20 +1470,20 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
nPointCount=aXP1.GetPointCount();
pPt2=&aXP1[1];
pPt3=&aXP1[nPointCount-2];
- pPt2->X()-=dx1/3;
- pPt2->Y()-=dy1/3;
- pPt3->X()-=dx2/3;
- pPt3->Y()-=dy2/3;
+ pPt2->AdjustX( -(dx1/3) );
+ pPt2->AdjustY( -(dy1/3) );
+ pPt3->AdjustX( -(dx2/3) );
+ pPt3->AdjustY( -(dy2/3) );
} else if (nPointCount>=4 && nPointCount<=6) { // Z or U or ...
// To all others, the end points of the original lines become control
// points for now. Thus, we need to do some more work for nPointCount>4!
aXP1.SetFlags(1,PolyFlags::Control);
aXP1.SetFlags(nPointCount-2,PolyFlags::Control);
// distance x1.5
- pPt2->X()+=dx1/2;
- pPt2->Y()+=dy1/2;
- pPt3->X()+=dx2/2;
- pPt3->Y()+=dy2/2;
+ pPt2->AdjustX(dx1/2 );
+ pPt2->AdjustY(dy1/2 );
+ pPt3->AdjustX(dx2/2 );
+ pPt3->AdjustY(dy2/2 );
if (nPointCount==5) {
// add a control point before and after center
Point aCenter(aXP1[2]);
@@ -1494,12 +1494,12 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
aXP1.Insert(2,aCenter,PolyFlags::Control);
aXP1.SetFlags(3,PolyFlags::Symmetric);
aXP1.Insert(4,aCenter,PolyFlags::Control);
- aXP1[2].X()-=dx1b/2;
- aXP1[2].Y()-=dy1b/2;
- aXP1[3].X()-=(dx1b+dx2b)/4;
- aXP1[3].Y()-=(dy1b+dy2b)/4;
- aXP1[4].X()-=dx2b/2;
- aXP1[4].Y()-=dy2b/2;
+ aXP1[2].AdjustX( -(dx1b/2) );
+ aXP1[2].AdjustY( -(dy1b/2) );
+ aXP1[3].AdjustX( -((dx1b+dx2b)/4) );
+ aXP1[3].AdjustY( -((dy1b+dy2b)/4) );
+ aXP1[4].AdjustX( -(dx2b/2) );
+ aXP1[4].AdjustY( -(dy2b/2) );
}
if (nPointCount==6) {
Point aPt1b(aXP1[2]);
@@ -1508,8 +1508,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const too
aXP1.Insert(5,aPt2b,PolyFlags::Control);
long dx=aPt1b.X()-aPt2b.X();
long dy=aPt1b.Y()-aPt2b.Y();
- aXP1[3].X()-=dx/2;
- aXP1[3].Y()-=dy/2;
+ aXP1[3].AdjustX( -(dx/2) );
+ aXP1[3].AdjustY( -(dy/2) );
aXP1.SetFlags(3,PolyFlags::Symmetric);
aXP1.Remove(4,1); // because it's identical with aXP1[3]
}
@@ -1784,8 +1784,8 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const
if (nPt>0) {
Point aPos((*pEdgeTrack)[static_cast<sal_uInt16>(nPt)]);
aPos+=(*pEdgeTrack)[static_cast<sal_uInt16>(nPt)+1];
- aPos.X()/=2;
- aPos.Y()/=2;
+ aPos.setX( aPos.X() / 2 );
+ aPos.setY( aPos.Y() / 2 );
pHdl->SetPos(aPos);
} else {
delete pHdl;
@@ -1972,15 +1972,15 @@ basegfx::B2DPolygon SdrEdgeObj::ImplAddConnectorOverlay(SdrDragMethod& rDragMeth
if (bTail1)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aMyCon1.aObjOfs.X(), aMyCon1.aObjOfs.Y()));
- aMyCon1.aObjOfs.X() = basegfx::fround(aTemp.getX());
- aMyCon1.aObjOfs.Y() = basegfx::fround(aTemp.getY());
+ aMyCon1.aObjOfs.setX( basegfx::fround(aTemp.getX()) );
+ aMyCon1.aObjOfs.setY( basegfx::fround(aTemp.getY()) );
}
if (bTail2)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aMyCon2.aObjOfs.X(), aMyCon2.aObjOfs.Y()));
- aMyCon2.aObjOfs.X() = basegfx::fround(aTemp.getX());
- aMyCon2.aObjOfs.Y() = basegfx::fround(aTemp.getY());
+ aMyCon2.aObjOfs.setX( basegfx::fround(aTemp.getX()) );
+ aMyCon2.aObjOfs.setY( basegfx::fround(aTemp.getY()) );
}
SdrEdgeInfoRec aInfo(aEdgeInfo);
@@ -2005,15 +2005,15 @@ basegfx::B2DPolygon SdrEdgeObj::ImplAddConnectorOverlay(SdrDragMethod& rDragMeth
if (bTail1)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aPt1.X(), aPt1.Y()));
- aPt1.X() = basegfx::fround(aTemp.getX());
- aPt1.Y() = basegfx::fround(aTemp.getY());
+ aPt1.setX( basegfx::fround(aTemp.getX()) );
+ aPt1.setY( basegfx::fround(aTemp.getY()) );
}
if (bTail2)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aPt2.X(), aPt2.Y()));
- aPt2.X() = basegfx::fround(aTemp.getX());
- aPt2.Y() = basegfx::fround(aTemp.getY());
+ aPt2.setX( basegfx::fround(aTemp.getX()) );
+ aPt2.setY( basegfx::fround(aTemp.getY()) );
}
aResult.append(basegfx::B2DPoint(aPt1.X(), aPt1.Y()));
@@ -2107,10 +2107,10 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
Size aHalfConSiz(nMarkHdSiz,nMarkHdSiz);
aHalfConSiz=pOut->PixelToLogic(aHalfConSiz);
tools::Rectangle aMouseRect(rPt,rPt);
- aMouseRect.Left() -=aHalfConSiz.Width();
- aMouseRect.Top() -=aHalfConSiz.Height();
- aMouseRect.Right() +=aHalfConSiz.Width();
- aMouseRect.Bottom()+=aHalfConSiz.Height();
+ aMouseRect.AdjustLeft( -(aHalfConSiz.Width()) );
+ aMouseRect.AdjustTop( -(aHalfConSiz.Height()) );
+ aMouseRect.AdjustRight(aHalfConSiz.Width() );
+ aMouseRect.AdjustBottom(aHalfConSiz.Height() );
sal_uInt16 nBoundHitTol=static_cast<sal_uInt16>(aHalfConSiz.Width())/2; if (nBoundHitTol==0) nBoundHitTol=1;
size_t no=pOL->GetObjCount();
bool bFnd = false;
@@ -2201,10 +2201,10 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
}
if (bFnd) {
tools::Rectangle aMouseRect2(rPt,rPt);
- aMouseRect.Left() -=nBoundHitTol;
- aMouseRect.Top() -=nBoundHitTol;
- aMouseRect.Right() +=nBoundHitTol;
- aMouseRect.Bottom()+=nBoundHitTol;
+ aMouseRect.AdjustLeft( -nBoundHitTol );
+ aMouseRect.AdjustTop( -nBoundHitTol );
+ aMouseRect.AdjustRight(nBoundHitTol );
+ aMouseRect.AdjustBottom(nBoundHitTol );
aObjBound.IsOver(aMouseRect2);
}
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index ceac4a34628b..0027053721ea 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1309,13 +1309,13 @@ void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrink
// Scale graphic to page size
if ( fGrfWH < fWinWH )
{
- aSize.Width() = static_cast<long>(aMaxSize.Height() * fGrfWH);
- aSize.Height()= aMaxSize.Height();
+ aSize.setWidth( static_cast<long>(aMaxSize.Height() * fGrfWH) );
+ aSize.setHeight( aMaxSize.Height() );
}
else if ( fGrfWH > 0.F )
{
- aSize.Width() = aMaxSize.Width();
- aSize.Height()= static_cast<long>(aMaxSize.Width() / fGrfWH);
+ aSize.setWidth( aMaxSize.Width() );
+ aSize.setHeight( static_cast<long>(aMaxSize.Width() / fGrfWH) );
}
aPos = rMaxRect.Center();
@@ -1324,8 +1324,8 @@ void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrink
if( bShrinkOnly )
aPos = maRect.TopLeft();
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
+ aPos.AdjustX( -(aSize.Width() / 2) );
+ aPos.AdjustY( -(aSize.Height() / 2) );
SetLogicRect( tools::Rectangle( aPos, aSize ) );
}
}
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index dfb0f1d2e779..0ad320da6b8c 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -418,12 +418,12 @@ void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Frac
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
Point aRef2(aRef1);
- aRef2.Y()++;
+ aRef2.AdjustY( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
if (bYMirr) {
Point aRef2(aRef1);
- aRef2.X()++;
+ aRef2.AdjustX( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
}
@@ -570,12 +570,12 @@ void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fractio
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
Point aRef2(aRef1);
- aRef2.Y()++;
+ aRef2.AdjustY( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
if (bYMirr) {
Point aRef2(aRef1);
- aRef2.X()++;
+ aRef2.AdjustX( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
}
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index fa6cc17cac2f..8e702e9f5a61 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -492,10 +492,10 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
long nHalfLen=(rPol.nLineLen-nNeedSiz-nArrow1Wdt/4-nArrow2Wdt/4) /2;
rPol.nMainlineCnt=2;
rPol.aMainline1.aP2=aMainlinePt1;
- rPol.aMainline1.aP2.X()+=nHalfLen;
+ rPol.aMainline1.aP2.AdjustX(nHalfLen );
RotatePoint(rPol.aMainline1.aP2,rPol.aMainline1.aP1,nLineSin,nLineCos);
rPol.aMainline2.aP1=aMainlinePt2;
- rPol.aMainline2.aP1.X()-=nHalfLen;
+ rPol.aMainline2.aP1.AdjustX( -nHalfLen );
RotatePoint(rPol.aMainline2.aP1,rPol.aMainline2.aP2,nLineSin,nLineCos);
}
} else {
@@ -507,8 +507,8 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
if (rPol.eUsedTextHPos==css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE) nLen2=nArrow2Len+nTextWdt;
}
rPol.aMainline1.aP1=aMainlinePt1;
- rPol.aMainline1.aP2=aMainlinePt1; rPol.aMainline1.aP2.X()-=nLen1; RotatePoint(rPol.aMainline1.aP2,aMainlinePt1,nLineSin,nLineCos);
- rPol.aMainline2.aP1=aMainlinePt2; rPol.aMainline2.aP1.X()+=nLen2; RotatePoint(rPol.aMainline2.aP1,aMainlinePt2,nLineSin,nLineCos);
+ rPol.aMainline1.aP2=aMainlinePt1; rPol.aMainline1.aP2.AdjustX( -nLen1 ); RotatePoint(rPol.aMainline1.aP2,aMainlinePt1,nLineSin,nLineCos);
+ rPol.aMainline2.aP1=aMainlinePt2; rPol.aMainline2.aP1.AdjustX(nLen2 ); RotatePoint(rPol.aMainline2.aP1,aMainlinePt2,nLineSin,nLineCos);
rPol.aMainline2.aP2=aMainlinePt2;
rPol.aMainline3.aP1=aMainlinePt1;
rPol.aMainline3.aP2=aMainlinePt2;
@@ -623,10 +623,10 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
// determine TextSize including text frame margins
Size aTextSize2(aMPol.aTextSize);
- if (aTextSize2.Width()<1) aTextSize2.Width()=1;
- if (aTextSize2.Height()<1) aTextSize2.Height()=1;
- aTextSize2.Width()+=GetTextLeftDistance()+GetTextRightDistance();
- aTextSize2.Height()+=GetTextUpperDistance()+GetTextLowerDistance();
+ if (aTextSize2.Width()<1) aTextSize2.setWidth(1 );
+ if (aTextSize2.Height()<1) aTextSize2.setHeight(1 );
+ aTextSize2.AdjustWidth(GetTextLeftDistance()+GetTextRightDistance() );
+ aTextSize2.AdjustHeight(GetTextUpperDistance()+GetTextLowerDistance() );
Point aPt1b(aMPol.aMainline1.aP1);
long nLen=aMPol.nLineLen;
@@ -649,47 +649,47 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
css::drawing::MeasureTextVertPos eMV=aMPol.eUsedTextVPos;
if (!bRota90) {
switch (eMH) {
- case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break;
- case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len+nLWdt; break;
- default: aTextPos.X()=aPt1b.X(); aTextSize2.Width()=nLen;
+ case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.setX(aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt ); break;
+ case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: aTextPos.setX(aPt1b.X()+nLen+nArr2Len+nLWdt ); break;
+ default: aTextPos.setX(aPt1b.X() ); aTextSize2.setWidth(nLen );
}
switch (eMV) {
case css::drawing::MeasureTextVertPos_CENTERED:
- aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()/2; break;
+ aTextPos.setY(aPt1b.Y()-aTextSize2.Height()/2 ); break;
case css::drawing::MeasureTextVertPos_WEST: {
- if (!bUpsideDown) aTextPos.Y()=aPt1b.Y()+nLWdt;
- else aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()-nLWdt;
+ if (!bUpsideDown) aTextPos.setY(aPt1b.Y()+nLWdt );
+ else aTextPos.setY(aPt1b.Y()-aTextSize2.Height()-nLWdt );
} break;
default: {
- if (!bUpsideDown) aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()-nLWdt;
- else aTextPos.Y()=aPt1b.Y()+nLWdt;
+ if (!bUpsideDown) aTextPos.setY(aPt1b.Y()-aTextSize2.Height()-nLWdt );
+ else aTextPos.setY(aPt1b.Y()+nLWdt );
}
}
if (bUpsideDown) {
- aTextPos.X()+=aTextSize2.Width();
- aTextPos.Y()+=aTextSize2.Height();
+ aTextPos.AdjustX(aTextSize2.Width() );
+ aTextPos.AdjustY(aTextSize2.Height() );
}
} else { // also if bTextRota90==TRUE
switch (eMH) {
- case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Height()-nArr1Len; break;
- case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len; break;
- default: aTextPos.X()=aPt1b.X(); aTextSize2.Height()=nLen;
+ case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: aTextPos.setX(aPt1b.X()-aTextSize2.Height()-nArr1Len ); break;
+ case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: aTextPos.setX(aPt1b.X()+nLen+nArr2Len ); break;
+ default: aTextPos.setX(aPt1b.X() ); aTextSize2.setHeight(nLen );
}
switch (eMV) {
case css::drawing::MeasureTextVertPos_CENTERED:
- aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()/2; break;
+ aTextPos.setY(aPt1b.Y()+aTextSize2.Width()/2 ); break;
case css::drawing::MeasureTextVertPos_WEST: {
- if (!bBelowRefEdge) aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()+nLWdt;
- else aTextPos.Y()=aPt1b.Y()-nLWdt;
+ if (!bBelowRefEdge) aTextPos.setY(aPt1b.Y()+aTextSize2.Width()+nLWdt );
+ else aTextPos.setY(aPt1b.Y()-nLWdt );
} break;
default: {
- if (!bBelowRefEdge) aTextPos.Y()=aPt1b.Y()-nLWdt;
- else aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()+nLWdt;
+ if (!bBelowRefEdge) aTextPos.setY(aPt1b.Y()-nLWdt );
+ else aTextPos.setY(aPt1b.Y()+aTextSize2.Width()+nLWdt );
}
}
if (bUpsideDown) {
- aTextPos.X()+=aTextSize2.Height();
- aTextPos.Y()-=aTextSize2.Width();
+ aTextPos.AdjustX(aTextSize2.Height() );
+ aTextPos.AdjustY( -(aTextSize2.Width()) );
}
}
if (aMPol.nTextAngle!=aGeo.nRotationAngle) {
@@ -697,7 +697,7 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
const_cast<SdrMeasureObj*>(this)->aGeo.RecalcSinCos();
}
RotatePoint(aTextPos,aPt1b,aMPol.nLineSin,aMPol.nLineCos);
- aTextSize2.Width()++; aTextSize2.Height()++; // because of the Rect-Ctor's odd behavior
+ aTextSize2.AdjustWidth( 1 ); aTextSize2.AdjustHeight( 1 ); // because of the Rect-Ctor's odd behavior
rRect=tools::Rectangle(aTextPos,aTextSize2);
rRect.Justify();
const_cast<SdrMeasureObj*>(this)->maRect=rRect;
@@ -920,8 +920,8 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c
if (bHor) ndy=long(ndy0*nXFact);
if (bVer) ndx=long(ndx0*nYFact);
aPt=aFix;
- aPt.X()+=ndx;
- aPt.Y()+=ndy;
+ aPt.AdjustX(ndx );
+ aPt.AdjustY(ndy );
} // else Ortho8
}
rMov=aPt;
@@ -1026,11 +1026,11 @@ void SdrMeasureObj::NbcRotate(const Point& rRef, long nAngle, double sn, double
dx=BigMulDiv(dx,nLen0,nLen1);
dy=BigMulDiv(dy,nLen0,nLen1);
if (rRef==aPt2) {
- aPt1.X()=aPt2.X()-dx;
- aPt1.Y()=aPt2.Y()-dy;
+ aPt1.setX(aPt2.X()-dx );
+ aPt1.setY(aPt2.Y()-dy );
} else {
- aPt2.X()=aPt1.X()+dx;
- aPt2.Y()=aPt1.Y()+dy;
+ aPt2.setX(aPt1.X()+dx );
+ aPt2.setY(aPt1.Y()+dy );
}
}
SetRectsDirty();
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index e3e46d3d9a82..8303e2b71fa9 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -197,13 +197,13 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin
// scale graphic to page size
if ( fGrfWH < fWinWH )
{
- aSize.Width() = static_cast<long>(aMaxSize.Height() * fGrfWH);
- aSize.Height()= aMaxSize.Height();
+ aSize.setWidth( static_cast<long>(aMaxSize.Height() * fGrfWH) );
+ aSize.setHeight( aMaxSize.Height() );
}
else if ( fGrfWH > 0.F )
{
- aSize.Width() = aMaxSize.Width();
- aSize.Height()= static_cast<long>(aMaxSize.Width() / fGrfWH);
+ aSize.setWidth( aMaxSize.Width() );
+ aSize.setHeight( static_cast<long>(aMaxSize.Width() / fGrfWH) );
}
aPos = rMaxRect.Center();
@@ -212,8 +212,8 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin
if( bShrinkOnly )
aPos = maRect.TopLeft();
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
+ aPos.AdjustX( -(aSize.Width() / 2) );
+ aPos.AdjustY( -(aSize.Height() / 2) );
SetLogicRect( tools::Rectangle( aPos, aSize ) );
}
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index bbaf3450dbbb..b574da18f22c 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -331,13 +331,13 @@ void ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Poi
if (dAngle<18000) {
nCircStAngle=NormAngle360(nTangAngle-9000);
nCircRelAngle=NormAngle360(2*dAngle);
- aCircCenter.X()+=svx::Round(nRad*cos((nTangAngle+9000)*nPi180));
- aCircCenter.Y()-=svx::Round(nRad*sin((nTangAngle+9000)*nPi180));
+ aCircCenter.AdjustX(svx::Round(nRad*cos((nTangAngle+9000)*nPi180)) );
+ aCircCenter.AdjustY( -(svx::Round(nRad*sin((nTangAngle+9000)*nPi180))) );
} else {
nCircStAngle=NormAngle360(nTangAngle+9000);
nCircRelAngle=-NormAngle360(36000-2*dAngle);
- aCircCenter.X()+=svx::Round(nRad*cos((nTangAngle-9000)*nPi180));
- aCircCenter.Y()-=svx::Round(nRad*sin((nTangAngle-9000)*nPi180));
+ aCircCenter.AdjustX(svx::Round(nRad*cos((nTangAngle-9000)*nPi180)) );
+ aCircCenter.AdjustY( -(svx::Round(nRad*sin((nTangAngle-9000)*nPi180))) );
}
bAngleSnap=pView!=nullptr && pView->IsAngleSnapEnabled();
if (bAngleSnap) {
@@ -462,8 +462,8 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point
y+=svx::Round(nGKathLen*sn);
x+=svx::Round(nGKathLen*cs);
}
- aRectP2.X()+=x;
- aRectP2.Y()+=y;
+ aRectP2.AdjustX(x );
+ aRectP2.AdjustY(y );
if (pView!=nullptr && pView->IsOrtho()) {
long dx1=aRectP2.X()-aRectP1.X(); long dx1a=std::abs(dx1);
long dy1=aRectP2.Y()-aRectP1.Y(); long dy1a=std::abs(dy1);
@@ -473,15 +473,15 @@ void ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point
if (b1MoreThan2 != pView->IsBigOrtho()) {
long xtemp=dy2a-dx1a; if (dx1<0) xtemp=-xtemp;
long ytemp=dx2a-dy1a; if (dy1<0) ytemp=-ytemp;
- aRectP2.X()+=xtemp;
- aRectP2.Y()+=ytemp;
- aRectP3.X()+=xtemp;
- aRectP3.Y()+=ytemp;
+ aRectP2.AdjustX(xtemp );
+ aRectP2.AdjustY(ytemp );
+ aRectP3.AdjustX(xtemp );
+ aRectP3.AdjustY(ytemp );
} else {
long xtemp=dy1a-dx2a; if (dx2<0) xtemp=-xtemp;
long ytemp=dx1a-dy2a; if (dy2<0) ytemp=-ytemp;
- aRectP3.X()+=xtemp;
- aRectP3.Y()+=ytemp;
+ aRectP3.AdjustX(xtemp );
+ aRectP3.AdjustY(ytemp );
}
}
bRect=true;
@@ -695,8 +695,8 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
if (bHor) ndy=long(ndy0*nXFact);
if (bVer) ndx=long(ndx0*nYFact);
aNeuPos1=aPnt1;
- aNeuPos1.X()+=ndx;
- aNeuPos1.Y()+=ndy;
+ aNeuPos1.AdjustX(ndx );
+ aNeuPos1.AdjustY(ndy );
}
}
if (nPnt2!=0xFFFF && !bNextIsControl) {
@@ -716,8 +716,8 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
if (bHor) ndy=long(ndy0*nXFact);
if (bVer) ndx=long(ndx0*nYFact);
aNeuPos2=aPnt2;
- aNeuPos2.X()+=ndx;
- aNeuPos2.Y()+=ndy;
+ aNeuPos2.AdjustX(ndx );
+ aNeuPos2.AdjustY(ndy );
}
}
if (bPnt1 && bPnt2) { // both alternatives exist (and compete)
@@ -894,12 +894,12 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat const & rDrag)
Point aRef1(mrSdrPathObject.GetSnapRect().Center());
if (bXMirr) {
Point aRef2(aRef1);
- aRef2.Y()++;
+ aRef2.AdjustY( 1 );
mrSdrPathObject.NbcMirrorGluePoints(aRef1,aRef2);
}
if (bYMirr) {
Point aRef2(aRef1);
- aRef2.X()++;
+ aRef2.AdjustX( 1 );
mrSdrPathObject.NbcMirrorGluePoints(aRef1,aRef2);
}
}
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index da431e9068e2..7f85da4b71a8 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -199,7 +199,7 @@ void SdrRectObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
if (aGeo.nShearAngle>0)
{
Point aRef(rRect.TopLeft());
- rRect.Left()-=nDst;
+ rRect.AdjustLeft( -nDst );
Point aTmpPt(rRect.TopLeft());
RotatePoint(aTmpPt,aRef,aGeo.nSin,aGeo.nCos);
aTmpPt-=rRect.TopLeft();
@@ -207,7 +207,7 @@ void SdrRectObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
}
else
{
- rRect.Right()-=nDst;
+ rRect.AdjustRight( -nDst );
}
}
}
@@ -335,7 +335,7 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const
if (a>b) a=b;
if (a<0) a=0;
aPnt=maRect.TopLeft();
- aPnt.X()+=a;
+ aPnt.AdjustX(a );
eKind = SdrHdlKind::Circle;
break;
}
@@ -520,10 +520,10 @@ SdrGluePoint SdrRectObj::GetVertexGluePoint(sal_uInt16 nPosNum) const
Point aPt;
switch (nPosNum) {
- case 0: aPt=maRect.TopCenter(); aPt.Y()-=nWdt; break;
- case 1: aPt=maRect.RightCenter(); aPt.X()+=nWdt; break;
- case 2: aPt=maRect.BottomCenter(); aPt.Y()+=nWdt; break;
- case 3: aPt=maRect.LeftCenter(); aPt.X()-=nWdt; break;
+ case 0: aPt=maRect.TopCenter(); aPt.AdjustY( -nWdt ); break;
+ case 1: aPt=maRect.RightCenter(); aPt.AdjustX(nWdt ); break;
+ case 2: aPt=maRect.BottomCenter(); aPt.AdjustY(nWdt ); break;
+ case 3: aPt=maRect.LeftCenter(); aPt.AdjustX( -nWdt ); break;
}
if (aGeo.nShearAngle!=0) ShearPoint(aPt,maRect.TopLeft(),aGeo.nTan);
if (aGeo.nRotationAngle!=0) RotatePoint(aPt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos);
@@ -546,10 +546,10 @@ SdrGluePoint SdrRectObj::GetCornerGluePoint(sal_uInt16 nPosNum) const
Point aPt;
switch (nPosNum) {
- case 0: aPt=maRect.TopLeft(); aPt.X()-=nWdt; aPt.Y()-=nWdt; break;
- case 1: aPt=maRect.TopRight(); aPt.X()+=nWdt; aPt.Y()-=nWdt; break;
- case 2: aPt=maRect.BottomRight(); aPt.X()+=nWdt; aPt.Y()+=nWdt; break;
- case 3: aPt=maRect.BottomLeft(); aPt.X()-=nWdt; aPt.Y()+=nWdt; break;
+ case 0: aPt=maRect.TopLeft(); aPt.AdjustX( -nWdt ); aPt.AdjustY( -nWdt ); break;
+ case 1: aPt=maRect.TopRight(); aPt.AdjustX(nWdt ); aPt.AdjustY( -nWdt ); break;
+ case 2: aPt=maRect.BottomRight(); aPt.AdjustX(nWdt ); aPt.AdjustY(nWdt ); break;
+ case 3: aPt=maRect.BottomLeft(); aPt.AdjustX( -nWdt ); aPt.AdjustY(nWdt ); break;
}
if (aGeo.nShearAngle!=0) ShearPoint(aPt,maRect.TopLeft(),aGeo.nTan);
if (aGeo.nRotationAngle!=0) RotatePoint(aPt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos);
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 4a9f69d1afe3..5449c5f8c877 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -198,9 +198,9 @@ void SdrTextObj::FitFrameToTextSize()
rOutliner.SetText(*pText->GetOutlinerParaObject());
Size aNewSize(rOutliner.CalcTextSize());
rOutliner.Clear();
- aNewSize.Width()++; // because of possible rounding errors
- aNewSize.Width()+=GetTextLeftDistance()+GetTextRightDistance();
- aNewSize.Height()+=GetTextUpperDistance()+GetTextLowerDistance();
+ aNewSize.AdjustWidth( 1 ); // because of possible rounding errors
+ aNewSize.AdjustWidth(GetTextLeftDistance()+GetTextRightDistance() );
+ aNewSize.AdjustHeight(GetTextUpperDistance()+GetTextLowerDistance() );
tools::Rectangle aNewRect(maRect);
aNewRect.SetSize(aNewSize);
ImpJustifyRect(aNewRect);
@@ -397,8 +397,8 @@ void SdrTextObj::ImpJustifyRect(tools::Rectangle& rRect)
{
if (!rRect.IsEmpty()) {
rRect.Justify();
- if (rRect.Left()==rRect.Right()) rRect.Right()++;
- if (rRect.Top()==rRect.Bottom()) rRect.Bottom()++;
+ if (rRect.Left()==rRect.Right()) rRect.AdjustRight( 1 );
+ if (rRect.Top()==rRect.Bottom()) rRect.AdjustBottom( 1 );
}
}
@@ -648,10 +648,10 @@ void SdrTextObj::TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const
TakeUnrotatedSnapRect(aAnkRect);
}
Point aRotateRef(aAnkRect.TopLeft());
- aAnkRect.Left()+=nLeftDist;
- aAnkRect.Top()+=nUpperDist;
- aAnkRect.Right()-=nRightDist;
- aAnkRect.Bottom()-=nLowerDist;
+ aAnkRect.AdjustLeft(nLeftDist );
+ aAnkRect.AdjustTop(nUpperDist );
+ aAnkRect.AdjustRight( -nRightDist );
+ aAnkRect.AdjustBottom( -nLowerDist );
// Since sizes may be bigger than the object bounds it is necessary to
// justify the rect now.
@@ -659,8 +659,8 @@ void SdrTextObj::TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const
if (bFrame) {
// TODO: Optimize this.
- if (aAnkRect.GetWidth()<2) aAnkRect.Right()=aAnkRect.Left()+1; // minimum size h and v: 2 px
- if (aAnkRect.GetHeight()<2) aAnkRect.Bottom()=aAnkRect.Top()+1;
+ if (aAnkRect.GetWidth()<2) aAnkRect.SetRight(aAnkRect.Left()+1 ); // minimum size h and v: 2 px
+ if (aAnkRect.GetHeight()<2) aAnkRect.SetBottom(aAnkRect.Top()+1 );
}
if (aGeo.nRotationAngle!=0) {
Point aTmpPt(aAnkRect.TopLeft());
@@ -819,17 +819,17 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe
{
long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width();
if (eHAdj==SDRTEXTHORZADJUST_CENTER)
- aTextPos.X()+=nFreeWdt/2;
+ aTextPos.AdjustX(nFreeWdt/2 );
if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
- aTextPos.X()+=nFreeWdt;
+ aTextPos.AdjustX(nFreeWdt );
}
if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM)
{
long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height();
if (eVAdj==SDRTEXTVERTADJUST_CENTER)
- aTextPos.Y()+=nFreeHgt/2;
+ aTextPos.AdjustY(nFreeHgt/2 );
if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
- aTextPos.Y()+=nFreeHgt;
+ aTextPos.AdjustY(nFreeHgt );
}
if (aGeo.nRotationAngle!=0)
RotatePoint(aTextPos,aAnkRect.TopLeft(),aGeo.nSin,aGeo.nCos);
@@ -1929,14 +1929,14 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
if(SdrTextAniDirection::Left == eDirection || SdrTextAniDirection::Right == eDirection)
{
- aScrollFrameRect.Left() = aAnchorRect.Left();
- aScrollFrameRect.Right() = aAnchorRect.Right();
+ aScrollFrameRect.SetLeft( aAnchorRect.Left() );
+ aScrollFrameRect.SetRight( aAnchorRect.Right() );
}
if(SdrTextAniDirection::Up == eDirection || SdrTextAniDirection::Down == eDirection)
{
- aScrollFrameRect.Top() = aAnchorRect.Top();
- aScrollFrameRect.Bottom() = aAnchorRect.Bottom();
+ aScrollFrameRect.SetTop( aAnchorRect.Top() );
+ aScrollFrameRect.SetBottom( aAnchorRect.Bottom() );
}
// create the MetaFile
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index f8c4f2105276..f4c9528d4125 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -92,15 +92,15 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt,
long nWdt = 0, nMinWdt = 0, nMaxWdt = 0;
Size aNewSize = rR.GetSize();
- aNewSize.Width()--; aNewSize.Height()--;
+ aNewSize.AdjustWidth( -1 ); aNewSize.AdjustHeight( -1 );
Size aMaxSiz(100000, 100000);
Size aTmpSiz = pModel->GetMaxObjSize();
if (aTmpSiz.Width())
- aMaxSiz.Width() = aTmpSiz.Width();
+ aMaxSiz.setWidth( aTmpSiz.Width() );
if (aTmpSiz.Height())
- aMaxSiz.Height() = aTmpSiz.Height();
+ aMaxSiz.setHeight( aTmpSiz.Height() );
if (bWdtGrow)
{
@@ -111,7 +111,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt,
if (nMinWdt <= 0)
nMinWdt = 1;
- aNewSize.Width() = nMaxWdt;
+ aNewSize.setWidth( nMaxWdt );
}
if (bHgtGrow)
@@ -123,25 +123,25 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt,
if (nMinHgt <= 0)
nMinHgt = 1;
- aNewSize.Height() = nMaxHgt;
+ aNewSize.setHeight( nMaxHgt );
}
long nHDist = GetTextLeftDistance() + GetTextRightDistance();
long nVDist = GetTextUpperDistance() + GetTextLowerDistance();
- aNewSize.Width() -= nHDist;
- aNewSize.Height() -= nVDist;
+ aNewSize.AdjustWidth( -nHDist );
+ aNewSize.AdjustHeight( -nVDist );
if (aNewSize.Width() < 2)
- aNewSize.Width() = 2;
+ aNewSize.setWidth( 2 );
if (aNewSize.Height() < 2)
- aNewSize.Height() = 2;
+ aNewSize.setHeight( 2 );
if (!IsInEditMode())
{
if (bHScroll)
- aNewSize.Width() = 0x0FFFFFFF; // don't break ticker text
+ aNewSize.setWidth( 0x0FFFFFFF ); // don't break ticker text
if (bVScroll)
- aNewSize.Height() = 0x0FFFFFFF;
+ aNewSize.setHeight( 0x0FFFFFFF );
}
if (pEdtOutl)
@@ -216,14 +216,14 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt,
SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust();
if (eHAdj == SDRTEXTHORZADJUST_LEFT)
- rR.Right() += nWdtGrow;
+ rR.AdjustRight(nWdtGrow );
else if (eHAdj == SDRTEXTHORZADJUST_RIGHT)
- rR.Left() -= nWdtGrow;
+ rR.AdjustLeft( -nWdtGrow );
else
{
long nWdtGrow2 = nWdtGrow / 2;
- rR.Left() -= nWdtGrow2;
- rR.Right() = rR.Left() + nWdt;
+ rR.AdjustLeft( -nWdtGrow2 );
+ rR.SetRight( rR.Left() + nWdt );
}
}
@@ -232,14 +232,14 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt,
SdrTextVertAdjust eVAdj = GetTextVerticalAdjust();
if (eVAdj == SDRTEXTVERTADJUST_TOP)
- rR.Bottom() += nHgtGrow;
+ rR.AdjustBottom(nHgtGrow );
else if (eVAdj == SDRTEXTVERTADJUST_BOTTOM)
- rR.Top() -= nHgtGrow;
+ rR.AdjustTop( -nHgtGrow );
else
{
long nHgtGrow2 = nHgtGrow / 2;
- rR.Top() -= nHgtGrow2;
- rR.Bottom() = rR.Top() + nHgt;
+ rR.AdjustTop( -nHgtGrow2 );
+ rR.SetBottom( rR.Top() + nHgt );
}
}
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index 7f8973e78b4b..c75de2cc0003 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -86,10 +86,10 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
bool bRgt=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Right || eHdl==SdrHdlKind::LowerRight);
bool bTop=(eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::Upper || eHdl==SdrHdlKind::UpperLeft);
bool bBtm=(eHdl==SdrHdlKind::LowerRight || eHdl==SdrHdlKind::Lower || eHdl==SdrHdlKind::LowerLeft);
- if (bLft) aTmpRect.Left() =aPos.X();
- if (bRgt) aTmpRect.Right() =aPos.X();
- if (bTop) aTmpRect.Top() =aPos.Y();
- if (bBtm) aTmpRect.Bottom()=aPos.Y();
+ if (bLft) aTmpRect.SetLeft(aPos.X() );
+ if (bRgt) aTmpRect.SetRight(aPos.X() );
+ if (bTop) aTmpRect.SetTop(aPos.Y() );
+ if (bBtm) aTmpRect.SetBottom(aPos.Y() );
if (bOrtho) { // Ortho
long nWdt0=maRect.Right() -maRect.Left();
long nHgt0=maRect.Bottom()-maRect.Top();
@@ -114,26 +114,26 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
if (bUseX) {
long nNeed=long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
if (bYNeg) nNeed=-nNeed;
- if (bTop) aTmpRect.Top()=aTmpRect.Bottom()-nNeed;
- if (bBtm) aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
+ if (bTop) aTmpRect.SetTop(aTmpRect.Bottom()-nNeed );
+ if (bBtm) aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
} else {
long nNeed=long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
if (bXNeg) nNeed=-nNeed;
- if (bLft) aTmpRect.Left()=aTmpRect.Right()-nNeed;
- if (bRgt) aTmpRect.Right()=aTmpRect.Left()+nNeed;
+ if (bLft) aTmpRect.SetLeft(aTmpRect.Right()-nNeed );
+ if (bRgt) aTmpRect.SetRight(aTmpRect.Left()+nNeed );
}
} else { // apex handles
if ((bLft || bRgt) && nXDiv!=0) {
long nHgt0b=maRect.Bottom()-maRect.Top();
long nNeed=long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
- aTmpRect.Top()-=(nNeed-nHgt0b)/2;
- aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
+ aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
+ aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
}
if ((bTop || bBtm) && nYDiv!=0) {
long nWdt0b=maRect.Right()-maRect.Left();
long nNeed=long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
- aTmpRect.Left()-=(nNeed-nWdt0b)/2;
- aTmpRect.Right()=aTmpRect.Left()+nNeed;
+ aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
+ aTmpRect.SetRight(aTmpRect.Left()+nNeed );
}
}
}
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 5f9591193525..3290435144b1 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -144,12 +144,12 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Recta
aViewInit.Move(aCenter.X(),aCenter.Y());
}
Size aAnkSiz(aViewInit.GetSize());
- aAnkSiz.Width()--; aAnkSiz.Height()--; // because GetSize() adds 1
+ aAnkSiz.AdjustWidth( -1 ); aAnkSiz.AdjustHeight( -1 ); // because GetSize() adds 1
Size aMaxSiz(1000000,1000000);
if (pModel!=nullptr) {
Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
+ if (aTmpSiz.Width()!=0) aMaxSiz.setWidth(aTmpSiz.Width() );
+ if (aTmpSiz.Height()!=0) aMaxSiz.setHeight(aTmpSiz.Height() );
}
// Done earlier since used in else tree below
@@ -206,15 +206,15 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Recta
}
}
- aPaperMax.Width()=nMaxWdt;
- aPaperMax.Height()=nMaxHgt;
+ aPaperMax.setWidth(nMaxWdt );
+ aPaperMax.setHeight(nMaxHgt );
}
else
{
aPaperMax=aMaxSiz;
}
- aPaperMin.Width()=nMinWdt;
- aPaperMin.Height()=nMinHgt;
+ aPaperMin.setWidth(nMinWdt );
+ aPaperMin.setHeight(nMinHgt );
}
else
{
@@ -233,30 +233,30 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Recta
*pViewMin=aViewInit;
long nXFree=aAnkSiz.Width()-aPaperMin.Width();
- if (eHAdj==SDRTEXTHORZADJUST_LEFT) pViewMin->Right()-=nXFree;
- else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) pViewMin->Left()+=nXFree;
- else { pViewMin->Left()+=nXFree/2; pViewMin->Right()=pViewMin->Left()+aPaperMin.Width(); }
+ if (eHAdj==SDRTEXTHORZADJUST_LEFT) pViewMin->AdjustRight( -nXFree );
+ else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) pViewMin->AdjustLeft(nXFree );
+ else { pViewMin->AdjustLeft(nXFree/2 ); pViewMin->SetRight(pViewMin->Left()+aPaperMin.Width() ); }
long nYFree=aAnkSiz.Height()-aPaperMin.Height();
- if (eVAdj==SDRTEXTVERTADJUST_TOP) pViewMin->Bottom()-=nYFree;
- else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) pViewMin->Top()+=nYFree;
- else { pViewMin->Top()+=nYFree/2; pViewMin->Bottom()=pViewMin->Top()+aPaperMin.Height(); }
+ if (eVAdj==SDRTEXTVERTADJUST_TOP) pViewMin->AdjustBottom( -nYFree );
+ else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) pViewMin->AdjustTop(nYFree );
+ else { pViewMin->AdjustTop(nYFree/2 ); pViewMin->SetBottom(pViewMin->Top()+aPaperMin.Height() ); }
}
// PaperSize should grow automatically in most cases
if(IsVerticalWriting())
- aPaperMin.Width() = 0;
+ aPaperMin.setWidth( 0 );
else
- aPaperMin.Height() = 0;
+ aPaperMin.setHeight( 0 );
if(eHAdj!=SDRTEXTHORZADJUST_BLOCK || bFitToSize) {
- aPaperMin.Width()=0;
+ aPaperMin.setWidth(0 );
}
// For complete vertical adjustment support, set paper min height to 0, here.
if(SDRTEXTVERTADJUST_BLOCK != eVAdj || bFitToSize)
{
- aPaperMin.Height() = 0;
+ aPaperMin.setHeight( 0 );
}
if (pPaperMin!=nullptr) *pPaperMin=aPaperMin;
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 04f28084af78..6ecdbcb47b22 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -110,12 +110,12 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
Point aRef1(GetSnapRect().Center());
if (bXMirr) {
Point aRef2(aRef1);
- aRef2.Y()++;
+ aRef2.AdjustY( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
if (bYMirr) {
Point aRef2(aRef1);
- aRef2.X()++;
+ aRef2.AdjustX( 1 );
NbcMirrorGluePoints(aRef1,aRef2);
}
}
@@ -191,10 +191,10 @@ void SdrTextObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
long dy=maRect.Bottom()-maRect.Top();
Point aP(maRect.TopLeft());
RotatePoint(aP,rRef,sn,cs);
- maRect.Left()=aP.X();
- maRect.Top()=aP.Y();
- maRect.Right()=maRect.Left()+dx;
- maRect.Bottom()=maRect.Top()+dy;
+ maRect.SetLeft(aP.X() );
+ maRect.SetTop(aP.Y() );
+ maRect.SetRight(maRect.Left()+dx );
+ maRect.SetBottom(maRect.Top()+dy );
if (aGeo.nRotationAngle==0) {
aGeo.nRotationAngle=NormAngle360(nAngle);
aGeo.nSin=sn;
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 764cd48aa212..728c06b861c3 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -142,8 +142,8 @@ SdrPageView::SdrPageView(SdrPage* pPage1, SdrView& rNewView)
if(mpPage)
{
- aPgOrg.X()=mpPage->GetLeftBorder();
- aPgOrg.Y()=mpPage->GetUpperBorder();
+ aPgOrg.setX(mpPage->GetLeftBorder() );
+ aPgOrg.setY(mpPage->GetUpperBorder() );
}
mbHasMarked = false;
aLayerVisi.SetAll();
@@ -701,10 +701,10 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const
OutputDevice& rOutDev = pCandidate->GetOutputDevice();
tools::Rectangle aR(rHL.GetBoundRect(rOutDev));
Size aSiz(rOutDev.PixelToLogic(Size(1,1)));
- aR.Left() -= aSiz.Width();
- aR.Right() += aSiz.Width();
- aR.Top() -= aSiz.Height();
- aR.Bottom() += aSiz.Height();
+ aR.AdjustLeft( -(aSiz.Width()) );
+ aR.AdjustRight(aSiz.Width() );
+ aR.AdjustTop( -(aSiz.Height()) );
+ aR.AdjustBottom(aSiz.Height() );
const_cast<SdrView&>(GetView()).InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aR);
}
}
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 9361d3620fbf..ee95936790d7 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -929,7 +929,7 @@ void SdrPaintView::InvalidateAllWin(const tools::Rectangle& rRect)
tools::Rectangle aRect(rRect);
Point aOrg(rOutDev.GetMapMode().GetOrigin());
- aOrg.X()=-aOrg.X(); aOrg.Y()=-aOrg.Y();
+ aOrg.setX(-aOrg.X() ); aOrg.setY(-aOrg.Y() );
tools::Rectangle aOutRect(aOrg, rOutDev.GetOutputSize());
// In case of tiled rendering we want to get all invalidations, so visual area is not interesting.
diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx
index 6b6e0968de92..94f1f5affc00 100644
--- a/svx/source/svdraw/svdsnpv.cxx
+++ b/svx/source/svdraw/svdsnpv.cxx
@@ -329,10 +329,10 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const
while (aIter.IsMore() && (nMaxPointSnapCount>0 || nMaxFrameSnapCount>0)) {
SdrObject* pO=aIter.Next();
tools::Rectangle aRect(pO->GetCurrentBoundRect());
- aRect.Left ()-=mx;
- aRect.Right ()+=mx;
- aRect.Top ()-=my;
- aRect.Bottom()+=my;
+ aRect.AdjustLeft( -mx );
+ aRect.AdjustRight(mx );
+ aRect.AdjustTop( -my );
+ aRect.AdjustBottom(my );
if (aRect.IsInside(rPnt)) {
if (bOPntSnap && nMaxPointSnapCount>0)
{
@@ -352,10 +352,10 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const
if (bOFrmSnap && nMaxFrameSnapCount>0) {
tools::Rectangle aLog(pO->GetSnapRect());
tools::Rectangle aR1(aLog);
- aR1.Left ()-=mx;
- aR1.Right ()+=mx;
- aR1.Top ()-=my;
- aR1.Bottom()+=my;
+ aR1.AdjustLeft( -mx );
+ aR1.AdjustRight(mx );
+ aR1.AdjustTop( -my );
+ aR1.AdjustBottom(my );
if (aR1.IsInside(rPnt)) {
if (std::abs(x-aLog.Left ())<=mx) { dx1=-(x-aLog.Left ()); if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
if (std::abs(x-aLog.Right ())<=mx) { dx1=-(x-aLog.Right ()); if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
@@ -403,8 +403,8 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const
SdrSnap bRet=SdrSnap::NOTSNAPPED;
if (dx==NOT_SNAPPED) dx=0; else bRet|=SdrSnap::XSNAPPED;
if (dy==NOT_SNAPPED) dy=0; else bRet|=SdrSnap::YSNAPPED;
- rPnt.X()=x+dx;
- rPnt.Y()=y+dy;
+ rPnt.setX(x+dx );
+ rPnt.setY(y+dy );
return bRet;
}
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index c110d62b444f..5d8719b7abea 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -40,19 +40,19 @@ void ResizeRect(tools::Rectangle& rRect, const Point& rRef, const Fraction& rxFa
SAL_WARN( "svx.svdraw", "invalid fraction xFract, using Fraction(1,1)" );
aXFact = Fraction(1,1);
long nWdt = rRect.Right() - rRect.Left();
- if (nWdt == 0) rRect.Right()++;
+ if (nWdt == 0) rRect.AdjustRight( 1 );
}
- rRect.Left() = rRef.X() + svx::Round( (rRect.Left() - rRef.X()) * double(aXFact) );
- rRect.Right() = rRef.X() + svx::Round( (rRect.Right() - rRef.X()) * double(aXFact) );
+ rRect.SetLeft( rRef.X() + svx::Round( (rRect.Left() - rRef.X()) * double(aXFact) ) );
+ rRect.SetRight( rRef.X() + svx::Round( (rRect.Right() - rRef.X()) * double(aXFact) ) );
if (!aYFact.IsValid()) {
SAL_WARN( "svx.svdraw", "invalid fraction yFract, using Fraction(1,1)" );
aYFact = Fraction(1,1);
long nHgt = rRect.Bottom() - rRect.Top();
- if (nHgt == 0) rRect.Bottom()++;
+ if (nHgt == 0) rRect.AdjustBottom( 1 );
}
- rRect.Top() = rRef.Y() + svx::Round( (rRect.Top() - rRef.Y()) * double(aYFact) );
- rRect.Bottom() = rRef.Y() + svx::Round( (rRect.Bottom() - rRef.Y()) * double(aYFact) );
+ rRect.SetTop( rRef.Y() + svx::Round( (rRect.Top() - rRef.Y()) * double(aYFact) ) );
+ rRect.SetBottom( rRef.Y() + svx::Round( (rRect.Bottom() - rRef.Y()) * double(aYFact) ) );
rRect.Justify();
}
@@ -104,20 +104,20 @@ void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2)
long my=rRef2.Y()-rRef1.Y();
if (mx==0) { // vertical axis
long dx=rRef1.X()-rPnt.X();
- rPnt.X()+=2*dx;
+ rPnt.AdjustX(2*dx );
} else if (my==0) { // horizontal axis
long dy=rRef1.Y()-rPnt.Y();
- rPnt.Y()+=2*dy;
+ rPnt.AdjustY(2*dy );
} else if (mx==my) { // diagonal axis '\'
long dx1=rPnt.X()-rRef1.X();
long dy1=rPnt.Y()-rRef1.Y();
- rPnt.X()=rRef1.X()+dy1;
- rPnt.Y()=rRef1.Y()+dx1;
+ rPnt.setX(rRef1.X()+dy1 );
+ rPnt.setY(rRef1.Y()+dx1 );
} else if (mx==-my) { // diagonal axis '/'
long dx1=rPnt.X()-rRef1.X();
long dy1=rPnt.Y()-rRef1.Y();
- rPnt.X()=rRef1.X()-dy1;
- rPnt.Y()=rRef1.Y()-dx1;
+ rPnt.setX(rRef1.X()-dy1 );
+ rPnt.setY(rRef1.Y()-dx1 );
} else { // arbitrary axis
// TODO: Optimize this! Raise perpendicular on the mirroring axis..?
long nRefWink=GetAngle(rRef2-rRef1);
@@ -172,36 +172,36 @@ double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCent
if (bC1) {
if (bVert) {
// move into the direction of the center, as a basic position for the rotation
- pC1->Y()-=y0;
+ pC1->AdjustY( -y0 );
// resize, account for the distance from the center
- pC1->Y()=svx::Round(static_cast<double>(pC1->Y()) /rRad.X()*(cx-pC1->X()));
- pC1->Y()+=cy;
+ pC1->setY(svx::Round(static_cast<double>(pC1->Y()) /rRad.X()*(cx-pC1->X())) );
+ pC1->AdjustY(cy );
} else {
// move into the direction of the center, as a basic position for the rotation
- pC1->X()-=x0;
+ pC1->AdjustX( -x0 );
// resize, account for the distance from the center
long nPntRad=cy-pC1->Y();
double nFact=static_cast<double>(nPntRad)/static_cast<double>(rRad.Y());
- pC1->X()=svx::Round(static_cast<double>(pC1->X())*nFact);
- pC1->X()+=cx;
+ pC1->setX(svx::Round(static_cast<double>(pC1->X())*nFact) );
+ pC1->AdjustX(cx );
}
RotatePoint(*pC1,rCenter,sn,cs);
}
if (bC2) {
if (bVert) {
// move into the direction of the center, as a basic position for the rotation
- pC2->Y()-=y0;
+ pC2->AdjustY( -y0 );
// resize, account for the distance from the center
- pC2->Y()=svx::Round(static_cast<double>(pC2->Y()) /rRad.X()*(rCenter.X()-pC2->X()));
- pC2->Y()+=cy;
+ pC2->setY(svx::Round(static_cast<double>(pC2->Y()) /rRad.X()*(rCenter.X()-pC2->X())) );
+ pC2->AdjustY(cy );
} else {
// move into the direction of the center, as a basic position for the rotation
- pC2->X()-=x0;
+ pC2->AdjustX( -x0 );
// resize, account for the distance from the center
long nPntRad=rCenter.Y()-pC2->Y();
double nFact=static_cast<double>(nPntRad)/static_cast<double>(rRad.Y());
- pC2->X()=svx::Round(static_cast<double>(pC2->X())*nFact);
- pC2->X()+=cx;
+ pC2->setX(svx::Round(static_cast<double>(pC2->X())*nFact) );
+ pC2->AdjustX(cx );
}
RotatePoint(*pC2,rCenter,sn,cs);
}
@@ -223,42 +223,42 @@ double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCente
if (bVert) {
long nStart=rCenter.X()-rRad.X();
dx1=rPnt.X()-nStart;
- rPnt.X()=nStart;
+ rPnt.setX(nStart );
if (bC1) {
dxC1=pC1->X()-nStart;
- pC1->X()=nStart;
+ pC1->setX(nStart );
}
if (bC2) {
dxC2=pC2->X()-nStart;
- pC2->X()=nStart;
+ pC2->setX(nStart );
}
} else {
long nStart=rCenter.Y()-rRad.Y();
dy1=rPnt.Y()-nStart;
- rPnt.Y()=nStart;
+ rPnt.setY(nStart );
if (bC1) {
dyC1=pC1->Y()-nStart;
- pC1->Y()=nStart;
+ pC1->setY(nStart );
}
if (bC2) {
dyC2=pC2->Y()-nStart;
- pC2->Y()=nStart;
+ pC2->setY(nStart );
}
}
double nAngle=GetCrookAngle(rPnt,rCenter,rRad,bVert);
double sn=sin(nAngle);
double cs=cos(nAngle);
RotatePoint(rPnt,rCenter,sn,cs);
- if (bC1) { if (bVert) pC1->Y()-=y0-rCenter.Y(); else pC1->X()-=x0-rCenter.X(); RotatePoint(*pC1,rCenter,sn,cs); }
- if (bC2) { if (bVert) pC2->Y()-=y0-rCenter.Y(); else pC2->X()-=x0-rCenter.X(); RotatePoint(*pC2,rCenter,sn,cs); }
+ if (bC1) { if (bVert) pC1->AdjustY( -(y0-rCenter.Y()) ); else pC1->AdjustX( -(x0-rCenter.X()) ); RotatePoint(*pC1,rCenter,sn,cs); }
+ if (bC2) { if (bVert) pC2->AdjustY( -(y0-rCenter.Y()) ); else pC2->AdjustX( -(x0-rCenter.X()) ); RotatePoint(*pC2,rCenter,sn,cs); }
if (bVert) {
- rPnt.X()+=dx1;
- if (bC1) pC1->X()+=dxC1;
- if (bC2) pC2->X()+=dxC2;
+ rPnt.AdjustX(dx1 );
+ if (bC1) pC1->AdjustX(dxC1 );
+ if (bC2) pC2->AdjustX(dxC2 );
} else {
- rPnt.Y()+=dy1;
- if (bC1) pC1->Y()+=dyC1;
- if (bC2) pC2->Y()+=dyC2;
+ rPnt.AdjustY(dy1 );
+ if (bC1) pC1->AdjustY(dyC1 );
+ if (bC2) pC2->AdjustY(dyC2 );
}
rSin=sn;
rCos=cs;
@@ -279,7 +279,7 @@ double CrookStretchXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCen
long dy=rPnt.Y()-y0;
double a=static_cast<double>(y0-nTop)/nHgt;
a*=dy;
- rPnt.Y()=y0+svx::Round(a);
+ rPnt.setY(y0+svx::Round(a) );
} return 0.0;
}
@@ -515,8 +515,8 @@ void Poly2Rect(const tools::Polygon& rPol, tools::Rectangle& rRect, GeoStat& rGe
rGeo.nShearAngle=nShW;
rGeo.RecalcTan();
Point aRU(aPt0);
- aRU.X()+=nWdt;
- aRU.Y()+=nHgt;
+ aRU.AdjustX(nWdt );
+ aRU.AdjustY(nHgt );
rRect=tools::Rectangle(aPt0,aRU);
}
@@ -528,12 +528,12 @@ void OrthoDistance8(const Point& rPt0, Point& rPt, bool bBigOrtho)
long dxa=std::abs(dx);
long dya=std::abs(dy);
if (dx==0 || dy==0 || dxa==dya) return;
- if (dxa>=dya*2) { rPt.Y()=rPt0.Y(); return; }
- if (dya>=dxa*2) { rPt.X()=rPt0.X(); return; }
+ if (dxa>=dya*2) { rPt.setY(rPt0.Y() ); return; }
+ if (dya>=dxa*2) { rPt.setX(rPt0.X() ); return; }
if ((dxa<dya) != bBigOrtho) {
- rPt.Y()=rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) );
+ rPt.setY(rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) ) );
} else {
- rPt.X()=rPt0.X()+(dya* (dx>=0 ? 1 : -1) );
+ rPt.setX(rPt0.X()+(dya* (dx>=0 ? 1 : -1) ) );
}
}
@@ -544,9 +544,9 @@ void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho)
long dxa=std::abs(dx);
long dya=std::abs(dy);
if ((dxa<dya) != bBigOrtho) {
- rPt.Y()=rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) );
+ rPt.setY(rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) ) );
} else {
- rPt.X()=rPt0.X()+(dya* (dx>=0 ? 1 : -1) );
+ rPt.setX(rPt0.X()+(dya* (dx>=0 ? 1 : -1) ) );
}
}
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 865ff1d0b8d2..1011c8a11e87 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -70,25 +70,25 @@ bool SdrExchangeView::ImpLimitToWorkArea(Point& rPt) const
{
if(rPt.X()<maMaxWorkArea.Left())
{
- rPt.X() = maMaxWorkArea.Left();
+ rPt.setX( maMaxWorkArea.Left() );
bRet = true;
}
if(rPt.X()>maMaxWorkArea.Right())
{
- rPt.X() = maMaxWorkArea.Right();
+ rPt.setX( maMaxWorkArea.Right() );
bRet = true;
}
if(rPt.Y()<maMaxWorkArea.Top())
{
- rPt.Y() = maMaxWorkArea.Top();
+ rPt.setY( maMaxWorkArea.Top() );
bRet = true;
}
if(rPt.Y()>maMaxWorkArea.Bottom())
{
- rPt.Y() = maMaxWorkArea.Bottom();
+ rPt.setY( maMaxWorkArea.Bottom() );
bRet = true;
}
}