summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/svdotext.hxx27
-rw-r--r--svx/source/svdraw/svdoashp.cxx118
-rw-r--r--svx/source/svdraw/svdocapt.cxx33
-rw-r--r--svx/source/svdraw/svdocirc.cxx127
-rw-r--r--svx/source/svdraw/svdoedge.cxx6
-rw-r--r--svx/source/svdraw/svdograf.cxx8
-rw-r--r--svx/source/svdraw/svdomeas.cxx2
-rw-r--r--svx/source/svdraw/svdomedia.cxx4
-rw-r--r--svx/source/svdraw/svdoole2.cxx21
-rw-r--r--svx/source/svdraw/svdopath.cxx6
-rw-r--r--svx/source/svdraw/svdorect.cxx84
-rw-r--r--svx/source/svdraw/svdotext.cxx67
-rw-r--r--svx/source/svdraw/svdotxat.cxx10
-rw-r--r--svx/source/svdraw/svdotxdr.cxx51
-rw-r--r--svx/source/svdraw/svdotxtr.cxx65
-rw-r--r--svx/source/svdraw/svdouno.cxx2
-rw-r--r--svx/source/table/svdotable.cxx115
17 files changed, 416 insertions, 330 deletions
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index a2574765ade7..a1cccb0804a4 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -165,7 +165,32 @@ protected:
// The "aRect" is also the rect of RectObj and CircObj.
// When mbTextFrame=true the text will be formatted into this rect
// When mbTextFrame=false the text will be centered around its middle
- tools::Rectangle maRect;
+ tools::Rectangle maRectangle;
+
+ tools::Rectangle const& getRectangle() const
+ {
+ return maRectangle;
+ }
+
+ void setRectangle(tools::Rectangle const& rRectangle)
+ {
+ maRectangle = rRectangle;
+ }
+
+ void setRectangleSize(sal_Int32 nWidth, sal_Int32 nHeight)
+ {
+ maRectangle.SetSize(Size(nWidth, nHeight));
+ }
+
+ void moveRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
+ {
+ maRectangle.Move(nXDelta, nYDelta);
+ }
+
+ void moveRectanglePosition(sal_Int32 nX, sal_Int32 nY)
+ {
+ maRectangle.SetPos(Point(nX, nY));
+ }
// The GeoStat contains the rotation and shear angles
GeoStat maGeo;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 44ecb8fefded..a6a56f417e6d 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1397,7 +1397,7 @@ void SdrObjCustomShape::AdaptTextMinSize()
// check if we need to change anything before creating an SfxItemSet, because that is expensive
const bool bResizeShapeToFitText(GetObjectItem(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue());
- tools::Rectangle aTextBound(maRect);
+ tools::Rectangle aTextBound(getRectangle());
bool bChanged(false);
if(bResizeShapeToFitText)
bChanged = true;
@@ -1432,10 +1432,11 @@ void SdrObjCustomShape::AdaptTextMinSize()
SetObjectItemSet(aSet);
}
-void SdrObjCustomShape::NbcSetSnapRect( const tools::Rectangle& rRect )
+void SdrObjCustomShape::NbcSetSnapRect(const tools::Rectangle& rRectangle)
{
- maRect = rRect;
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(rRectangle);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
InvalidateRenderGeometry();
AdaptTextMinSize();
@@ -1455,10 +1456,11 @@ void SdrObjCustomShape::SetSnapRect( const tools::Rectangle& rRect )
SendUserCall(SdrUserCallType::Resize,aBoundRect0);
}
-void SdrObjCustomShape::NbcSetLogicRect( const tools::Rectangle& rRect )
+void SdrObjCustomShape::NbcSetLogicRect(const tools::Rectangle& rRectangle)
{
- maRect = rRect;
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(rRectangle);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
InvalidateRenderGeometry();
AdaptTextMinSize();
@@ -1515,7 +1517,7 @@ void SdrObjCustomShape::NbcMove( const Size& rSiz )
void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, const Fraction& ryFact )
{
// taking care of handles that should not been changed
- tools::Rectangle aOld( maRect );
+ tools::Rectangle aOld(getRectangle());
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
SdrTextObj::NbcResize( rRef, rxFact, ryFact );
@@ -1543,17 +1545,17 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_X )
{
- sal_Int32 nX = ( rInteraction.aPosition.X - aOld.Left() ) + maRect.Left();
+ sal_Int32 nX = ( rInteraction.aPosition.X - aOld.Left() ) + getRectangle().Left();
rInteraction.xInteraction->setControllerPosition(awt::Point(nX, rInteraction.xInteraction->getPosition().Y));
}
else if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX )
{
- sal_Int32 nX = maRect.Right() - (aOld.Right() - rInteraction.aPosition.X);
+ sal_Int32 nX = getRectangle().Right() - (aOld.Right() - rInteraction.aPosition.X);
rInteraction.xInteraction->setControllerPosition(awt::Point(nX, rInteraction.xInteraction->getPosition().Y));
}
if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_Y )
{
- sal_Int32 nY = ( rInteraction.aPosition.Y - aOld.Top() ) + maRect.Top();
+ sal_Int32 nY = ( rInteraction.aPosition.Y - aOld.Top() ) + getRectangle().Top();
rInteraction.xInteraction->setControllerPosition(awt::Point(rInteraction.xInteraction->getPosition().X, nY));
}
}
@@ -1598,7 +1600,7 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, Degree100 nAngle, double s
// the rotation angle for ashapes is stored in fObjectRotation, this rotation
// has to be applied to the text object (which is internally using maGeo.nAngle).
- SdrTextObj::NbcRotate( maRect.TopLeft(), -maGeo.nRotationAngle, // retrieving the unrotated text object
+ SdrTextObj::NbcRotate( getRectangle().TopLeft(), -maGeo.nRotationAngle, // retrieving the unrotated text object
-maGeo.mfSinRotationAngle,
maGeo.mfCosRotationAngle );
maGeo.nRotationAngle = 0_deg100; // resetting aGeo data
@@ -1612,7 +1614,7 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, Degree100 nAngle, double s
nW = nW % 36000_deg100;
if ( nW < 0_deg100 )
nW = 36000_deg100 + nW;
- SdrTextObj::NbcRotate( maRect.TopLeft(), nW, // applying text rotation
+ SdrTextObj::NbcRotate( getRectangle().TopLeft(), nW, // applying text rotation
sin( toRadians(nW) ),
cos( toRadians(nW) ) );
@@ -1723,14 +1725,18 @@ SdrGluePoint SdrObjCustomShape::GetVertexGluePoint(sal_uInt16 nPosNum) const
}
Point aPt;
- switch (nPosNum) {
- 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 (maGeo.nShearAngle != 0_deg100) ShearPoint(aPt, maRect.TopLeft(), maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle != 0_deg100) RotatePoint(aPt, maRect.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ auto aRectangle = getRectangle();
+ switch (nPosNum)
+ {
+ case 0: aPt = aRectangle.TopCenter(); aPt.AdjustY( -nWdt ); break;
+ case 1: aPt = aRectangle.RightCenter(); aPt.AdjustX(nWdt ); break;
+ case 2: aPt = aRectangle.BottomCenter(); aPt.AdjustY(nWdt ); break;
+ case 3: aPt = aRectangle.LeftCenter(); aPt.AdjustX( -nWdt ); break;
+ }
+ if (maGeo.nShearAngle != 0_deg100)
+ ShearPoint(aPt, aRectangle.TopLeft(), maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle != 0_deg100)
+ RotatePoint(aPt, aRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
aPt-=GetSnapRect().Center();
SdrGluePoint aGP(aPt);
aGP.SetPercent(false);
@@ -1779,19 +1785,19 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
if (maGeo.nRotationAngle || nShearAngle || bMirroredX || bMirroredY)
{
- tools::Polygon aPoly( maRect );
+ tools::Polygon aPoly(getRectangle());
if( nShearAngle )
{
sal_uInt16 nPointCount=aPoly.GetSize();
for (sal_uInt16 i=0; i<nPointCount; i++)
- ShearPoint(aPoly[i],maRect.Center(), fTan );
+ ShearPoint(aPoly[i], getRectangle().Center(), fTan );
}
if (maGeo.nRotationAngle)
- aPoly.Rotate( maRect.Center(), to<Degree10>(maGeo.nRotationAngle) );
+ aPoly.Rotate( getRectangle().Center(), to<Degree10>(maGeo.nRotationAngle) );
tools::Rectangle aBoundRect( aPoly.GetBoundRect() );
- sal_Int32 nXDiff = aBoundRect.Left() - maRect.Left();
- sal_Int32 nYDiff = aBoundRect.Top() - maRect.Top();
+ sal_Int32 nXDiff = aBoundRect.Left() - getRectangle().Left();
+ sal_Int32 nYDiff = aBoundRect.Top() - getRectangle().Top();
if (nShearAngle && bMirroredX != bMirroredY)
{
@@ -1799,7 +1805,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
fTan = -fTan;
}
- Point aRef( maRect.GetWidth() / 2, maRect.GetHeight() / 2 );
+ Point aRef( getRectangle().GetWidth() / 2, getRectangle().GetHeight() / 2 );
for ( a = 0; a < aNewList.GetCount(); a++ )
{
SdrGluePoint& rPoint = aNewList[ a ];
@@ -1810,9 +1816,9 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
RotatePoint(aGlue, aRef, sin(basegfx::deg2rad(fObjectRotation)),
cos(basegfx::deg2rad(fObjectRotation)));
if ( bMirroredX )
- aGlue.setX( maRect.GetWidth() - aGlue.X() );
+ aGlue.setX( getRectangle().GetWidth() - aGlue.X() );
if ( bMirroredY )
- aGlue.setY( maRect.GetHeight() - aGlue.Y() );
+ aGlue.setY( getRectangle().GetHeight() - aGlue.Y() );
aGlue.AdjustX( -nXDiff );
aGlue.AdjustY( -nYDiff );
rPoint.SetPos( aGlue );
@@ -1937,7 +1943,7 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const
void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect )
{
- tools::Rectangle aOld( maRect );
+ tools::Rectangle aOld(getRectangle());
bool bOldMirroredX( IsMirroredX() );
bool bOldMirroredY( IsMirroredY() );
@@ -1947,7 +1953,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
GeoStat aGeoStat( GetGeoStat() );
- if ( aNewRect.TopLeft()!= maRect.TopLeft() &&
+ if ( aNewRect.TopLeft() != getRectangle().TopLeft() &&
( maGeo.nRotationAngle || maGeo.nShearAngle ) )
{
Point aNewPos( aNewRect.TopLeft() );
@@ -1955,7 +1961,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
if ( maGeo.nRotationAngle ) RotatePoint(aNewPos, aOld.TopLeft(), aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle );
aNewRect.SetPos( aNewPos );
}
- if ( aNewRect == maRect )
+ if (aNewRect == getRectangle())
return;
SetLogicRect( aNewRect );
@@ -1991,17 +1997,17 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
{
nX = ( rInteraction.aPosition.X - aOld.Right() );
if ( rNewRect.Left() > rNewRect.Right() )
- nX = maRect.Left() - nX;
+ nX = getRectangle().Left() - nX;
else
- nX += maRect.Right();
+ nX += getRectangle().Right();
}
else
{
nX = ( rInteraction.aPosition.X - aOld.Left() );
if ( rNewRect.Left() > rNewRect.Right() )
- nX = maRect.Right() - nX;
+ nX = getRectangle().Right() - nX;
else
- nX += maRect.Left();
+ nX += getRectangle().Left();
}
rInteraction.xInteraction->setControllerPosition(awt::Point(nX, rInteraction.xInteraction->getPosition().Y));
}
@@ -2012,17 +2018,17 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
{
nY = ( rInteraction.aPosition.Y - aOld.Bottom() );
if ( rNewRect.Top() > rNewRect.Bottom() )
- nY = maRect.Top() - nY;
+ nY = getRectangle().Top() - nY;
else
- nY += maRect.Bottom();
+ nY += getRectangle().Bottom();
}
else
{
nY = ( rInteraction.aPosition.Y - aOld.Top() );
if ( rNewRect.Top() > rNewRect.Bottom() )
- nY = maRect.Bottom() - nY;
+ nY = getRectangle().Bottom() - nY;
else
- nY += maRect.Top();
+ nY += getRectangle().Top();
}
rInteraction.xInteraction->setControllerPosition(awt::Point(rInteraction.xInteraction->getPosition().X, nY));
}
@@ -2052,7 +2058,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination,
sal_Int32 nXDiff = aPt.X - aInteractionHandle.aPosition.X;
sal_Int32 nYDiff = aPt.Y - aInteractionHandle.aPosition.Y;
- maRect.Move( nXDiff, nYDiff );
+ moveRectangle(nXDiff, nYDiff);
moveOutRectangle(nXDiff, nYDiff);
maSnapRect.Move( nXDiff, nYDiff );
SetBoundAndSnapRectsDirty(/*bNotMyself*/true);
@@ -2134,12 +2140,12 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
if ( !aInteractionHandles.empty() )
{
sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X;
- aRect1.Move( maRect.Left() - nHandlePos, 0 );
+ aRect1.Move(getRectangle().Left() - nHandlePos, 0);
}
}
ImpJustifyRect( aRect1 );
rStat.SetActionRect( aRect1 );
- maRect = aRect1;
+ setRectangle(aRect1);
SetBoundAndSnapRectsDirty();
for (const auto& rInteraction : aInteractionHandles)
@@ -2446,9 +2452,9 @@ tools::Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, cons
{
tools::Rectangle aReturnValue;
- tools::Rectangle aOldTextRect( maRect ); // <- initial text rectangle
+ tools::Rectangle aOldTextRect(getRectangle()); // <- initial text rectangle
- tools::Rectangle aNewTextRect( maRect ); // <- new text rectangle returned from the custom shape renderer,
+ tools::Rectangle aNewTextRect(getRectangle()); // <- new text rectangle returned from the custom shape renderer,
GetTextBounds( aNewTextRect ); // it depends to the current logical shape size
tools::Rectangle aAdjustedTextRect( aNewTextRect ); // <- new text rectangle is being tested by AdjustTextFrameWidthAndHeight to ensure
@@ -2457,7 +2463,7 @@ tools::Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, cons
if (aAdjustedTextRect != aNewTextRect && aOldTextRect != aAdjustedTextRect &&
aNewTextRect.GetWidth() && aNewTextRect.GetHeight())
{
- aReturnValue = maRect;
+ aReturnValue = getRectangle();
double fXScale = static_cast<double>(aOldTextRect.GetWidth()) / static_cast<double>(aNewTextRect.GetWidth());
double fYScale = static_cast<double>(aOldTextRect.GetHeight()) / static_cast<double>(aNewTextRect.GetHeight());
double fRightDiff = static_cast<double>( aAdjustedTextRect.Right() - aNewTextRect.Right() ) * fXScale;
@@ -2476,7 +2482,7 @@ tools::Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, cons
bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
tools::Rectangle aNewTextRect = ImpCalculateTextFrame(bHgt, bWdt);
- const bool bRet = !aNewTextRect.IsEmpty() && aNewTextRect != maRect;
+ const bool bRet = !aNewTextRect.IsEmpty() && aNewTextRect != getRectangle();
if (bRet && !mbAdjustingTextFrameWidthAndHeight)
{
mbAdjustingTextFrameWidthAndHeight = true;
@@ -2484,7 +2490,7 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
// taking care of handles that should not been changed
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
- maRect = aNewTextRect;
+ setRectangle(aNewTextRect);
SetBoundAndSnapRectsDirty();
SetChanged();
@@ -2509,7 +2515,7 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight()
{
tools::Rectangle aNewTextRect = ImpCalculateTextFrame( true/*bHgt*/, true/*bWdt*/ );
- bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != maRect );
+ bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != getRectangle());
if ( bRet )
{
tools::Rectangle aBoundRect0;
@@ -2519,7 +2525,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight()
// taking care of handles that should not been changed
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
- maRect = aNewTextRect;
+ setRectangle(aNewTextRect);
SetBoundAndSnapRectsDirty();
for (const auto& rInteraction : aInteractionHandles)
@@ -2887,8 +2893,8 @@ void SdrObjCustomShape::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
// invalidating rectangles by SetRectsDirty is not sufficient,
// AdjustTextFrameWidthAndHeight() also has to be made, both
// actions are done by NbcSetSnapRect
- tools::Rectangle aTmp( maRect ); //creating temporary rectangle #i61108#
- NbcSetSnapRect( aTmp );
+ tools::Rectangle aRectangle(getRectangle()); //creating temporary rectangle #i61108#
+ NbcSetSnapRect(aRectangle);
}
}
@@ -3109,8 +3115,8 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf
double fRotate = basegfx::deg2rad(fObjectRotation);
double fShearX = toRadians(maGeo.nShearAngle);
- // get aRect, this is the unrotated snaprect
- tools::Rectangle aRectangle(maRect);
+ // get aRectangle, this is the unrotated snaprect
+ tools::Rectangle aRectangle(getRectangle());
bool bMirroredX = IsMirroredX();
bool bMirroredY = IsMirroredY();
@@ -3122,7 +3128,7 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf
if ( bMirroredX )
{
fShearX = -fShearX;
- tools::Polygon aPol = Rect2Poly(maRect, aNewGeo);
+ tools::Polygon aPol = Rect2Poly(getRectangle(), aNewGeo);
tools::Rectangle aBoundRect( aPol.GetBoundRect() );
Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
@@ -3163,7 +3169,7 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf
aPol[2]=aPol0[3]; // it was *not* wrong even when the reordering
aPol[3]=aPol0[2]; // *seems* to be specific for X-Mirrorings. Oh
aPol[4]=aPol0[1]; // will I be happy when this old stuff is |gone| with aw080 (!)
- Poly2Rect(aPol,aRectangle,aNewGeo);
+ Poly2Rect(aPol, aRectangle, aNewGeo);
}
}
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 6a886272bad1..14e7678499c7 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -308,7 +308,7 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const
return false;
rDrag.SetNoSnap();
- rDrag.SetActionRect(maRect);
+ rDrag.SetActionRect(getRectangle());
Point aHit(rDrag.GetStart());
@@ -341,15 +341,15 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag)
}
else
{
- Point aDelt(rDrag.GetNow()-rDrag.GetStart());
+ Point aDelta(rDrag.GetNow()-rDrag.GetStart());
if(!pHdl)
{
- maRect.Move(aDelt.X(),aDelt.Y());
+ moveRectangle(aDelta.X(), aDelta.Y());
}
else
{
- aTailPoly[0] += aDelt;
+ aTailPoly[0] += aDelta;
}
ImpRecalcTail();
@@ -408,7 +408,7 @@ void SdrCaptionObj::ImpRecalcTail()
{
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- ImpCalcTail(aPara, aTailPoly, maRect);
+ ImpCalcTail(aPara, aTailPoly, getRectangle());
SetBoundAndSnapRectsDirty();
SetXPolyDirty();
}
@@ -511,14 +511,15 @@ void SdrCaptionObj::ImpCalcTail(const ImpCaptParams& rPara, tools::Polygon& rPol
bool SdrCaptionObj::BegCreate(SdrDragStat& rStat)
{
- if (maRect.IsEmpty()) return false; // Create currently only works with the given Rect
+ if (getRectangle().IsEmpty())
+ return false; // Create currently only works with the given Rect
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- maRect.SetPos(rStat.GetNow());
+ moveRectanglePosition(rStat.GetNow().X(), rStat.GetNow().Y());
aTailPoly[0]=rStat.GetStart();
- ImpCalcTail(aPara,aTailPoly,maRect);
- rStat.SetActionRect(maRect);
+ ImpCalcTail(aPara,aTailPoly, getRectangle());
+ rStat.SetActionRect(getRectangle());
return true;
}
@@ -526,9 +527,9 @@ bool SdrCaptionObj::MovCreate(SdrDragStat& rStat)
{
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- maRect.SetPos(rStat.GetNow());
- ImpCalcTail(aPara,aTailPoly,maRect);
- rStat.SetActionRect(maRect);
+ moveRectanglePosition(rStat.GetNow().X(), rStat.GetNow().Y());
+ ImpCalcTail(aPara,aTailPoly, getRectangle());
+ rStat.SetActionRect(getRectangle());
SetBoundRectDirty();
m_bSnapRectDirty=true;
return true;
@@ -538,8 +539,8 @@ bool SdrCaptionObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- maRect.SetPos(rStat.GetNow());
- ImpCalcTail(aPara,aTailPoly,maRect);
+ moveRectanglePosition(rStat.GetNow().X(), rStat.GetNow().Y());
+ ImpCalcTail(aPara,aTailPoly, getRectangle());
SetBoundAndSnapRectsDirty();
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
}
@@ -556,7 +557,7 @@ void SdrCaptionObj::BrkCreate(SdrDragStat& /*rStat*/)
basegfx::B2DPolyPolygon SdrCaptionObj::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
{
basegfx::B2DPolyPolygon aRetval;
- const basegfx::B2DRange aRange =vcl::unotools::b2DRectangleFromRectangle(maRect);
+ const basegfx::B2DRange aRange =vcl::unotools::b2DRectangleFromRectangle(getRectangle());
aRetval.append(basegfx::utils::createPolygonFromRect(aRange));
aRetval.append(aTailPoly.getB2DPolygon());
return aRetval;
@@ -598,7 +599,7 @@ Point SdrCaptionObj::GetRelativePos() const
const tools::Rectangle& SdrCaptionObj::GetLogicRect() const
{
- return maRect;
+ return getRectangle();
}
void SdrCaptionObj::NbcSetLogicRect(const tools::Rectangle& rRect)
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 1207548114bf..ab8bc58ddf85 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -312,14 +312,14 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind,
void SdrCircObj::RecalcXPoly()
{
- basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle));
+ basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, getRectangle(), nStartAngle, nEndAngle));
mpXPoly = XPolygon(aPolyCirc);
}
OUString SdrCircObj::TakeObjNameSingul() const
{
TranslateId pID=STR_ObjNameSingulCIRC;
- if (maRect.GetWidth() == maRect.GetHeight() && maGeo.nShearAngle==0_deg100)
+ if (getRectangle().GetWidth() == getRectangle().GetHeight() && maGeo.nShearAngle == 0_deg100)
{
switch (meCircleKind) {
case SdrCircKind::Full: pID=STR_ObjNameSingulCIRC; break;
@@ -348,7 +348,7 @@ OUString SdrCircObj::TakeObjNameSingul() const
OUString SdrCircObj::TakeObjNamePlural() const
{
TranslateId pID=STR_ObjNamePluralCIRC;
- if (maRect.GetWidth() == maRect.GetHeight() && maGeo.nShearAngle==0_deg100)
+ if (getRectangle().GetWidth() == getRectangle().GetHeight() && maGeo.nShearAngle == 0_deg100)
{
switch (meCircleKind) {
case SdrCircKind::Full: pID=STR_ObjNamePluralCIRC; break;
@@ -376,7 +376,7 @@ rtl::Reference<SdrObject> SdrCircObj::CloneSdrObject(SdrModel& rTargetModel) con
basegfx::B2DPolyPolygon SdrCircObj::TakeXorPoly() const
{
- const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle));
+ const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, getRectangle(), nStartAngle, nEndAngle));
return basegfx::B2DPolyPolygon(aCircPolygon);
}
@@ -423,61 +423,61 @@ void SdrCircObj::AddToHdlList(SdrHdlList& rHdlList) const
Point aPnt;
SdrHdlKind eLocalKind(SdrHdlKind::Move);
sal_uInt32 nPNum(0);
-
+ tools::Rectangle aRectangle = getRectangle();
switch (nHdlNum)
{
case 0:
- aPnt = GetAnglePnt(maRect,nStartAngle);
+ aPnt = GetAnglePnt(aRectangle, nStartAngle);
eLocalKind = SdrHdlKind::Circle;
nPNum = 1;
break;
case 1:
- aPnt = GetAnglePnt(maRect,nEndAngle);
+ aPnt = GetAnglePnt(aRectangle, nEndAngle);
eLocalKind = SdrHdlKind::Circle;
nPNum = 2;
break;
case 2:
- aPnt = maRect.TopLeft();
+ aPnt = aRectangle.TopLeft();
eLocalKind = SdrHdlKind::UpperLeft;
break;
case 3:
- aPnt = maRect.TopCenter();
+ aPnt = aRectangle.TopCenter();
eLocalKind = SdrHdlKind::Upper;
break;
case 4:
- aPnt = maRect.TopRight();
+ aPnt = aRectangle.TopRight();
eLocalKind = SdrHdlKind::UpperRight;
break;
case 5:
- aPnt = maRect.LeftCenter();
+ aPnt = aRectangle.LeftCenter();
eLocalKind = SdrHdlKind::Left;
break;
case 6:
- aPnt = maRect.RightCenter();
+ aPnt = aRectangle.RightCenter();
eLocalKind = SdrHdlKind::Right;
break;
case 7:
- aPnt = maRect.BottomLeft();
+ aPnt = aRectangle.BottomLeft();
eLocalKind = SdrHdlKind::LowerLeft;
break;
case 8:
- aPnt = maRect.BottomCenter();
+ aPnt = aRectangle.BottomCenter();
eLocalKind = SdrHdlKind::Lower;
break;
case 9:
- aPnt = maRect.BottomRight();
+ aPnt = aRectangle.BottomRight();
eLocalKind = SdrHdlKind::LowerRight;
break;
}
if (maGeo.nShearAngle)
{
- ShearPoint(aPnt, maRect.TopLeft(), maGeo.mfTanShearAngle);
+ ShearPoint(aPnt, aRectangle.TopLeft(), maGeo.mfTanShearAngle);
}
if (maGeo.nRotationAngle)
{
- RotatePoint(aPnt, maRect.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aPnt, aRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
}
std::unique_ptr<SdrHdl> pH(new SdrHdl(aPnt,eLocalKind));
@@ -520,15 +520,15 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag)
Point aPt(rDrag.GetNow());
if (maGeo.nRotationAngle)
- RotatePoint(aPt,maRect.TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aPt, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
if (maGeo.nShearAngle)
- ShearPoint(aPt,maRect.TopLeft(), -maGeo.mfTanShearAngle);
+ ShearPoint(aPt, getRectangle().TopLeft(), -maGeo.mfTanShearAngle);
- aPt -= maRect.Center();
+ aPt -= getRectangle().Center();
- tools::Long nWdt = maRect.Right() - maRect.Left();
- tools::Long nHgt = maRect.Bottom() - maRect.Top();
+ tools::Long nWdt = getRectangle().Right() - getRectangle().Left();
+ tools::Long nHgt = getRectangle().Bottom() - getRectangle().Top();
if(nWdt>=nHgt)
{
@@ -696,7 +696,7 @@ bool SdrCircObj::BegCreate(SdrDragStat& rStat)
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
aRect1.Normalize();
rStat.SetActionRect(aRect1);
- maRect = aRect1;
+ setRectangle(aRect1);
ImpSetCreateParams(rStat);
return true;
}
@@ -706,8 +706,8 @@ bool SdrCircObj::MovCreate(SdrDragStat& rStat)
ImpSetCreateParams(rStat);
ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser());
rStat.SetActionRect(pU->aR);
- maRect = pU->aR; // for ObjName
- ImpJustifyRect(maRect);
+ setRectangle(pU->aR); // for ObjName
+ ImpJustifyRect(maRectangle);
nStartAngle=pU->nStart;
nEndAngle=pU->nEnd;
SetBoundRectDirty();
@@ -733,16 +733,18 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
if (meCircleKind==SdrCircKind::Full) {
bRet=rStat.GetPointCount()>=2;
if (bRet) {
- maRect = pU->aR;
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(pU->aR);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
}
} else {
rStat.SetNoSnap(rStat.GetPointCount()>=2);
rStat.SetOrtho4Possible(rStat.GetPointCount()<2);
bRet=rStat.GetPointCount()>=4;
if (bRet) {
- maRect = pU->aR;
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(pU->aR);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
nStartAngle=pU->nStart;
nEndAngle=pU->nEnd;
}
@@ -809,7 +811,7 @@ PointerStyle SdrCircObj::GetCreatePointer() const
void SdrCircObj::NbcMove(const Size& aSize)
{
- maRect.Move(aSize);
+ moveRectangle(aSize.Width(), aSize.Height());
moveOutRectangle(aSize.Width(), aSize.Height());
maSnapRect.Move(aSize);
SetXPolyDirty();
@@ -880,9 +882,9 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
Point aTmpPt1;
Point aTmpPt2;
if (bFreeMirr) { // some preparations for using an arbitrary axis of reflection
- Point aCenter(maRect.Center());
- tools::Long nWdt=maRect.GetWidth()-1;
- tools::Long nHgt=maRect.GetHeight()-1;
+ Point aCenter(getRectangle().Center());
+ tools::Long nWdt = getRectangle().GetWidth() - 1;
+ tools::Long nHgt = getRectangle().GetHeight() - 1;
tools::Long nMaxRad=(std::max(nWdt,nHgt)+1) /2;
// starting point
double a = toRadians(nStartAngle);
@@ -898,13 +900,13 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
aTmpPt2+=aCenter;
if (maGeo.nRotationAngle)
{
- RotatePoint(aTmpPt1, maRect.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
- RotatePoint(aTmpPt2, maRect.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aTmpPt1, getRectangle().TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aTmpPt2, getRectangle().TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
}
if (maGeo.nShearAngle)
{
- ShearPoint(aTmpPt1, maRect.TopLeft(), maGeo.mfTanShearAngle);
- ShearPoint(aTmpPt2, maRect.TopLeft(), maGeo.mfTanShearAngle);
+ ShearPoint(aTmpPt1, getRectangle().TopLeft(), maGeo.mfTanShearAngle);
+ ShearPoint(aTmpPt2, getRectangle().TopLeft(), maGeo.mfTanShearAngle);
}
}
SdrTextObj::NbcMirror(rRef1,rRef2);
@@ -914,16 +916,16 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
// unrotate:
if (maGeo.nRotationAngle)
{
- RotatePoint(aTmpPt1, maRect.TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle); // -sin for reversion
- RotatePoint(aTmpPt2, maRect.TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle); // -sin for reversion
+ RotatePoint(aTmpPt1, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle); // -sin for reversion
+ RotatePoint(aTmpPt2, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle); // -sin for reversion
}
// unshear:
if (maGeo.nShearAngle)
{
- ShearPoint(aTmpPt1, maRect.TopLeft(), -maGeo.mfTanShearAngle); // -tan for reversion
- ShearPoint(aTmpPt2, maRect.TopLeft(), -maGeo.mfTanShearAngle); // -tan for reversion
+ ShearPoint(aTmpPt1, getRectangle().TopLeft(), -maGeo.mfTanShearAngle); // -tan for reversion
+ ShearPoint(aTmpPt2, getRectangle().TopLeft(), -maGeo.mfTanShearAngle); // -tan for reversion
}
- Point aCenter(maRect.Center());
+ Point aCenter(getRectangle().Center());
aTmpPt1-=aCenter;
aTmpPt2-=aCenter;
// because it's mirrored, the angles are swapped, too
@@ -971,37 +973,37 @@ static void Union(tools::Rectangle& rR, const Point& rP)
void SdrCircObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
{
- rRect = maRect;
+ rRect = getRectangle();
if (meCircleKind!=SdrCircKind::Full) {
- const Point aPntStart(GetAnglePnt(maRect,nStartAngle));
- const Point aPntEnd(GetAnglePnt(maRect,nEndAngle));
+ const Point aPntStart(GetAnglePnt(getRectangle(), nStartAngle));
+ const Point aPntEnd(GetAnglePnt(getRectangle(), nEndAngle));
Degree100 a=nStartAngle;
Degree100 e=nEndAngle;
- rRect.SetLeft(maRect.Right() );
- rRect.SetRight(maRect.Left() );
- rRect.SetTop(maRect.Bottom() );
- rRect.SetBottom(maRect.Top() );
+ rRect.SetLeft(getRectangle().Right() );
+ rRect.SetRight(getRectangle().Left() );
+ rRect.SetTop(getRectangle().Bottom() );
+ rRect.SetBottom(getRectangle().Top() );
Union(rRect,aPntStart);
Union(rRect,aPntEnd);
if ((a<=18000_deg100 && e>=18000_deg100) || (a>e && (a<=18000_deg100 || e>=18000_deg100))) {
- Union(rRect,maRect.LeftCenter());
+ Union(rRect, getRectangle().LeftCenter());
}
if ((a<=27000_deg100 && e>=27000_deg100) || (a>e && (a<=27000_deg100 || e>=27000_deg100))) {
- Union(rRect,maRect.BottomCenter());
+ Union(rRect, getRectangle().BottomCenter());
}
if (a>e) {
- Union(rRect,maRect.RightCenter());
+ Union(rRect, getRectangle().RightCenter());
}
if ((a<=9000_deg100 && e>=9000_deg100) || (a>e && (a<=9000_deg100 || e>=9000_deg100))) {
- Union(rRect,maRect.TopCenter());
+ Union(rRect, getRectangle().TopCenter());
}
if (meCircleKind==SdrCircKind::Section) {
- Union(rRect,maRect.Center());
+ Union(rRect, getRectangle().Center());
}
if (maGeo.nRotationAngle)
{
Point aDst(rRect.TopLeft());
- aDst-=maRect.TopLeft();
+ aDst -= getRectangle().TopLeft();
Point aDst0(aDst);
RotatePoint(aDst,Point(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
aDst-=aDst0;
@@ -1046,8 +1048,8 @@ void SdrCircObj::NbcSetSnapRect(const tools::Rectangle& rRect)
NbcResize(maSnapRect.TopLeft(),Fraction(nWdt1,nWdt0),Fraction(nHgt1,nHgt0));
NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top()));
} else {
- maRect=rRect;
- ImpJustifyRect(maRect);
+ setRectangle(rRect);
+ ImpJustifyRect(maRectangle);
}
SetBoundAndSnapRectsDirty();
SetXPolyDirty();
@@ -1065,10 +1067,11 @@ sal_uInt32 SdrCircObj::GetSnapPointCount() const
Point SdrCircObj::GetSnapPoint(sal_uInt32 i) const
{
- switch (i) {
- case 1 : return GetAnglePnt(maRect,nStartAngle);
- case 2 : return GetAnglePnt(maRect,nEndAngle);
- default: return maRect.Center();
+ switch (i)
+ {
+ case 1 : return GetAnglePnt(getRectangle(), nStartAngle);
+ case 2 : return GetAnglePnt(getRectangle(), nEndAngle);
+ default: return getRectangle().Center();
}
}
@@ -1140,7 +1143,7 @@ void SdrCircObj::ImpSetCircInfoToAttr()
rtl::Reference<SdrObject> SdrCircObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
const bool bFill(meCircleKind != SdrCircKind::Arc);
- const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle));
+ const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, getRectangle(), nStartAngle, nEndAngle));
rtl::Reference<SdrObject> pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier);
if(bAddText)
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 20cec97a77b5..d63c837f6e90 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1725,7 +1725,7 @@ void SdrEdgeObj::SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly )
// #i110629# also set aRect and maSnapeRect depending on pEdgeTrack
const tools::Rectangle aPolygonBounds(pEdgeTrack->GetBoundRect());
- maRect = aPolygonBounds;
+ setRectangle(aPolygonBounds);
maSnapRect = aPolygonBounds;
}
}
@@ -2280,11 +2280,11 @@ void SdrEdgeObj::NbcSetSnapRect(const tools::Rectangle& rRect)
if(aOld == rRect)
return;
- if (maRect.IsEmpty() && 0 == pEdgeTrack->GetPointCount())
+ if (getRectangle().IsEmpty() && 0 == pEdgeTrack->GetPointCount())
{
// #i110629# When initializing, do not scale on empty Rectangle; this
// will mirror the underlying text object (!)
- maRect = rRect;
+ setRectangle(rRect);
maSnapRect = rRect;
}
else
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index d9becdfdb80d..5b910e523b1c 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -913,7 +913,7 @@ rtl::Reference<SdrObject> SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAdd
ImpSdrGDIMetaFileImport aFilter(
getSdrModelFromSdrObject(),
GetLayer(),
- maRect);
+ getRectangle());
rtl::Reference<SdrObjGroup> pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
if(aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0))
@@ -925,13 +925,13 @@ rtl::Reference<SdrObject> SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAdd
if(aGeoStat.nShearAngle)
{
aGeoStat.RecalcTan();
- pGrp->NbcShear(maRect.TopLeft(), aGeoStat.nShearAngle, aGeoStat.mfTanShearAngle, false);
+ pGrp->NbcShear(getRectangle().TopLeft(), aGeoStat.nShearAngle, aGeoStat.mfTanShearAngle, false);
}
if(aGeoStat.nRotationAngle)
{
aGeoStat.RecalcSinCos();
- pGrp->NbcRotate(maRect.TopLeft(), aGeoStat.nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle);
+ pGrp->NbcRotate(getRectangle().TopLeft(), aGeoStat.nRotationAngle, aGeoStat.mfSinRotationAngle, aGeoStat.mfCosRotationAngle);
}
}
@@ -1097,7 +1097,7 @@ void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrink
}
if( bShrinkOnly )
- aPos = maRect.TopLeft();
+ aPos = getRectangle().TopLeft();
aPos.AdjustX( -(aSize.Width() / 2) );
aPos.AdjustY( -(aSize.Height() / 2) );
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 5e402646ef66..ee53dc085b32 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -698,7 +698,7 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
aTextSize2.AdjustWidth( 1 ); aTextSize2.AdjustHeight( 1 ); // because of the Rect-Ctor's odd behavior
rRect=tools::Rectangle(aTextPos,aTextSize2);
rRect.Normalize();
- const_cast<SdrMeasureObj*>(this)->maRect=rRect;
+ const_cast<SdrMeasureObj*>(this)->setRectangle(rRect);
if (aMPol.nTextAngle != maGeo.nRotationAngle) {
const_cast<SdrMeasureObj*>(this)->maGeo.nRotationAngle=aMPol.nTextAngle;
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index c63df5d8b69e..17785a5d693a 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -245,7 +245,7 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin
}
if( bShrinkOnly )
- aPos = maRect.TopLeft();
+ aPos = getRectangle().TopLeft();
aPos.AdjustX( -(aSize.Width() / 2) );
aPos.AdjustY( -(aSize.Height() / 2) );
@@ -484,7 +484,7 @@ void SdrMediaObj::notifyPropertiesForLOKit()
json.put("id", mediaId);
json.put("url", m_xImpl->m_MediaProperties.getTempURL());
- const tools::Rectangle aRect = o3tl::convert(maRect, o3tl::Length::mm100, o3tl::Length::twip);
+ const tools::Rectangle aRect = o3tl::convert(getRectangle(), o3tl::Length::mm100, o3tl::Length::twip);
json.put("x", aRect.getX());
json.put("y", aRect.getY());
json.put("w", aRect.getOpenWidth());
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index a5ebed7ce7ce..3661aa260d14 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1476,8 +1476,8 @@ void SdrOle2Obj::ImpSetVisAreaSize()
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) );
Size aVisSize;
if (sal_Int32(aScaleWidth) != 0 && sal_Int32(aScaleHeight) != 0) // avoid div by zero
- aVisSize = Size( static_cast<tools::Long>( Fraction( maRect.GetWidth() ) / aScaleWidth ),
- static_cast<tools::Long>( Fraction( maRect.GetHeight() ) / aScaleHeight ) );
+ aVisSize = Size( static_cast<tools::Long>( Fraction( getRectangle().GetWidth() ) / aScaleWidth ),
+ static_cast<tools::Long>( Fraction( getRectangle().GetHeight() ) / aScaleHeight ) );
aVisSize = OutputDevice::LogicToLogic(
aVisSize,
@@ -1503,18 +1503,15 @@ void SdrOle2Obj::ImpSetVisAreaSize()
// server changed VisArea to its liking and the VisArea is different than the suggested one
// store the new value as given by the object
MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) );
- maRect.SetSize(
- OutputDevice::LogicToLogic(
- aAcceptedVisArea.GetSize(),
- MapMode(aNewMapUnit),
- MapMode(getSdrModelFromSdrObject().GetScaleUnit())));
+ auto aSize = OutputDevice::LogicToLogic(aAcceptedVisArea.GetSize(), MapMode(aNewMapUnit), MapMode(getSdrModelFromSdrObject().GetScaleUnit()));
+ setRectangleSize(aSize.Width(), aSize.Height());
}
// make the new object area known to the client
// compared to the "else" branch aRect might have been changed by the object and no additional scaling was applied
// WHY this -> OSL_ASSERT( pClient );
if( pClient )
- pClient->SetObjArea(maRect);
+ pClient->SetObjArea(getRectangle());
// we need a new replacement image as the object has resized itself
@@ -1535,7 +1532,7 @@ void SdrOle2Obj::ImpSetVisAreaSize()
{
if ( pClient )
{
- tools::Rectangle aScaleRect(maRect.TopLeft(), aObjAreaSize);
+ tools::Rectangle aScaleRect(getRectangle().TopLeft(), aObjAreaSize);
pClient->SetObjAreaAndScale( aScaleRect, aScaleWidth, aScaleHeight);
}
else
@@ -1556,8 +1553,8 @@ void SdrOle2Obj::ImpSetVisAreaSize()
const MapUnit aMapUnit(
VCLUnoHelper::UnoEmbed2VCLMapUnit(
mpImpl->mxObjRef->getMapUnit(GetAspect())));
- const Point aTL( maRect.TopLeft() );
- const Point aBR( maRect.BottomRight() );
+ const Point aTL( getRectangle().TopLeft() );
+ const Point aBR( getRectangle().BottomRight() );
const Point aTL2(
OutputDevice::LogicToLogic(
aTL,
@@ -1868,7 +1865,7 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei
MapMode aMapMode(getSdrModelFromSdrObject().GetScaleUnit());
aObjAreaSize = mpImpl->mxObjRef.GetSize( &aMapMode );
- Size aSize = maRect.GetSize();
+ Size aSize = getRectangle().GetSize();
aScaleWidth = Fraction(aSize.Width(), aObjAreaSize.Width() );
aScaleHeight = Fraction(aSize.Height(), aObjAreaSize.Height() );
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index a4998647c835..78012451b2bd 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -1682,7 +1682,7 @@ void SdrPathObj::ImpForceLineAngle()
maGeo.RecalcTan();
// for SdrTextObj, keep aRect up to date
- maRect = tools::Rectangle::Normalize(aPoint0, aPoint1);
+ setRectangle(tools::Rectangle::Normalize(aPoint0, aPoint1));
}
void SdrPathObj::ImpForceKind()
@@ -1746,7 +1746,7 @@ void SdrPathObj::ImpForceKind()
// #i10659# for SdrTextObj, keep aRect up to date
if(GetPathPoly().count())
{
- maRect = lcl_ImpGetBoundRect(GetPathPoly());
+ setRectangle(lcl_ImpGetBoundRect(GetPathPoly()));
}
}
@@ -2469,7 +2469,7 @@ void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum)
if(GetPathPoly().count())
{
// #i10659# for SdrTextObj, keep aRect up to date
- maRect = lcl_ImpGetBoundRect(GetPathPoly());
+ setRectangle(lcl_ImpGetBoundRect(GetPathPoly()));
}
}
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 989fe0685e6b..a11151fb280d 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -122,14 +122,14 @@ XPolygon SdrRectObj::ImpCalcXPoly(const tools::Rectangle& rRect1, tools::Long nR
aXPoly=aNewPoly;
// these angles always relate to the top left corner of aRect
- if (maGeo.nShearAngle) ShearXPoly(aXPoly,maRect.TopLeft(),maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle) RotateXPoly(aXPoly,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ if (maGeo.nShearAngle) ShearXPoly(aXPoly, getRectangle().TopLeft(), maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle) RotateXPoly(aXPoly, getRectangle().TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
return aXPoly;
}
void SdrRectObj::RecalcXPoly()
{
- mpXPoly = ImpCalcXPoly(maRect,GetEckenradius());
+ mpXPoly = ImpCalcXPoly(getRectangle(), GetEckenradius());
}
const XPolygon& SdrRectObj::GetXPoly() const
@@ -177,11 +177,11 @@ SdrObjKind SdrRectObj::GetObjIdentifier() const
void SdrRectObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
{
- rRect = maRect;
+ rRect = getRectangle();
if (maGeo.nShearAngle==0_deg100)
return;
- tools::Long nDst=FRound((maRect.Bottom()-maRect.Top()) * maGeo.mfTanShearAngle);
+ tools::Long nDst=FRound((getRectangle().Bottom()-getRectangle().Top()) * maGeo.mfTanShearAngle);
if (maGeo.nShearAngle>0_deg100)
{
Point aRef(rRect.TopLeft());
@@ -210,7 +210,7 @@ OUString SdrRectObj::TakeObjNameSingul() const
{
pResId = bRounded ? STR_ObjNameSingulPARALRND : STR_ObjNameSingulPARAL; // parallelogram or, maybe, rhombus
}
- else if (maRect.GetWidth() == maRect.GetHeight())
+ else if (getRectangle().GetWidth() == getRectangle().GetHeight())
{
pResId = bRounded ? STR_ObjNameSingulQUADRND : STR_ObjNameSingulQUAD; // square
}
@@ -236,7 +236,7 @@ OUString SdrRectObj::TakeObjNamePlural() const
{
pResId = bRounded ? STR_ObjNamePluralPARALRND : STR_ObjNamePluralPARAL; // parallelogram or rhombus
}
- else if (maRect.GetWidth() == maRect.GetHeight())
+ else if (getRectangle().GetWidth() == getRectangle().GetHeight())
{
pResId = bRounded ? STR_ObjNamePluralQUADRND : STR_ObjNamePluralQUAD; // square
}
@@ -252,7 +252,7 @@ rtl::Reference<SdrObject> SdrRectObj::CloneSdrObject(SdrModel& rTargetModel) con
basegfx::B2DPolyPolygon SdrRectObj::TakeXorPoly() const
{
XPolyPolygon aXPP;
- aXPP.Insert(ImpCalcXPoly(maRect,GetEckenradius()));
+ aXPP.Insert(ImpCalcXPoly(getRectangle(), GetEckenradius()));
return aXPP.getB2DPolyPolygon();
}
@@ -289,7 +289,7 @@ void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const
if(IsTextFrame())
{
OSL_ENSURE(!IsTextEditActive(), "Do not use an ImpTextframeHdl for highlighting text in active text edit, this will collide with EditEngine paints (!)");
- std::unique_ptr<SdrHdl> pH(new ImpTextframeHdl(maRect));
+ std::unique_ptr<SdrHdl> pH(new ImpTextframeHdl(getRectangle()));
pH->SetObj(const_cast<SdrRectObj*>(this));
pH->SetRotationAngle(maGeo.nRotationAngle);
rHdlList.AddHdl(std::move(pH));
@@ -299,37 +299,37 @@ void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const
{
Point aPnt;
SdrHdlKind eKind = SdrHdlKind::Move;
-
+ auto const& rRectangle = getRectangle();
switch(nHdlNum)
{
case 1: // Handle for changing the corner radius
{
tools::Long a = GetEckenradius();
- tools::Long b = std::max(maRect.GetWidth(),maRect.GetHeight())/2; // rounded up, because GetWidth() adds 1
+ tools::Long b = std::max(rRectangle.GetWidth(), rRectangle.GetHeight())/2; // rounded up, because GetWidth() adds 1
if (a>b) a=b;
if (a<0) a=0;
- aPnt=maRect.TopLeft();
+ aPnt = rRectangle.TopLeft();
aPnt.AdjustX(a );
eKind = SdrHdlKind::Circle;
break;
}
- case 2: aPnt=maRect.TopLeft(); eKind = SdrHdlKind::UpperLeft; break;
- case 3: aPnt=maRect.TopCenter(); eKind = SdrHdlKind::Upper; break;
- case 4: aPnt=maRect.TopRight(); eKind = SdrHdlKind::UpperRight; break;
- case 5: aPnt=maRect.LeftCenter(); eKind = SdrHdlKind::Left ; break;
- case 6: aPnt=maRect.RightCenter(); eKind = SdrHdlKind::Right; break;
- case 7: aPnt=maRect.BottomLeft(); eKind = SdrHdlKind::LowerLeft; break;
- case 8: aPnt=maRect.BottomCenter(); eKind = SdrHdlKind::Lower; break;
- case 9: aPnt=maRect.BottomRight(); eKind = SdrHdlKind::LowerRight; break;
+ case 2: aPnt = rRectangle.TopLeft(); eKind = SdrHdlKind::UpperLeft; break;
+ case 3: aPnt = rRectangle.TopCenter(); eKind = SdrHdlKind::Upper; break;
+ case 4: aPnt = rRectangle.TopRight(); eKind = SdrHdlKind::UpperRight; break;
+ case 5: aPnt = rRectangle.LeftCenter(); eKind = SdrHdlKind::Left ; break;
+ case 6: aPnt = rRectangle.RightCenter(); eKind = SdrHdlKind::Right; break;
+ case 7: aPnt = rRectangle.BottomLeft(); eKind = SdrHdlKind::LowerLeft; break;
+ case 8: aPnt = rRectangle.BottomCenter(); eKind = SdrHdlKind::Lower; break;
+ case 9: aPnt = rRectangle.BottomRight(); eKind = SdrHdlKind::LowerRight; break;
}
if (maGeo.nShearAngle)
{
- ShearPoint(aPnt,maRect.TopLeft(),maGeo.mfTanShearAngle);
+ ShearPoint(aPnt,rRectangle.TopLeft(),maGeo.mfTanShearAngle);
}
if (maGeo.nRotationAngle)
{
- RotatePoint(aPnt,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ RotatePoint(aPnt,rRectangle.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
}
std::unique_ptr<SdrHdl> pH(new SdrHdl(aPnt,eKind));
@@ -367,9 +367,9 @@ bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag)
Point aPt(rDrag.GetNow());
if (maGeo.nRotationAngle)
- RotatePoint(aPt, maRect.TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aPt, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
- sal_Int32 nRad(aPt.X() - maRect.Left());
+ sal_Int32 nRad(aPt.X() - getRectangle().Left());
if (nRad < 0)
nRad = 0;
@@ -405,9 +405,9 @@ OUString SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
// -sin for reversal
if (maGeo.nRotationAngle)
- RotatePoint(aPt, maRect.TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ RotatePoint(aPt, getRectangle().TopLeft(), -maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
- sal_Int32 nRad(aPt.X() - maRect.Left());
+ sal_Int32 nRad(aPt.X() - getRectangle().Left());
if(nRad < 0)
nRad = 0;
@@ -484,14 +484,17 @@ SdrGluePoint SdrRectObj::GetVertexGluePoint(sal_uInt16 nPosNum) const
}
Point aPt;
+ auto const& rRectangle = getRectangle();
switch (nPosNum) {
- 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;
+ case 0: aPt = rRectangle.TopCenter(); aPt.AdjustY( -nWdt ); break;
+ case 1: aPt = rRectangle.RightCenter(); aPt.AdjustX(nWdt ); break;
+ case 2: aPt = rRectangle.BottomCenter(); aPt.AdjustY(nWdt ); break;
+ case 3: aPt = rRectangle.LeftCenter(); aPt.AdjustX( -nWdt ); break;
}
- if (maGeo.nShearAngle) ShearPoint(aPt, maRect.TopLeft(), maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle) RotatePoint(aPt, maRect.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
+ if (maGeo.nShearAngle)
+ ShearPoint(aPt, rRectangle.TopLeft(), maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle)
+ RotatePoint(aPt, rRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
aPt-=GetSnapRect().Center();
SdrGluePoint aGP(aPt);
aGP.SetPercent(false);
@@ -510,14 +513,17 @@ SdrGluePoint SdrRectObj::GetCornerGluePoint(sal_uInt16 nPosNum) const
}
Point aPt;
+ auto const& rRectangle = getRectangle();
switch (nPosNum) {
- 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;
+ case 0: aPt = rRectangle.TopLeft(); aPt.AdjustX( -nWdt ); aPt.AdjustY( -nWdt ); break;
+ case 1: aPt = rRectangle.TopRight(); aPt.AdjustX(nWdt ); aPt.AdjustY( -nWdt ); break;
+ case 2: aPt = rRectangle.BottomRight(); aPt.AdjustX(nWdt ); aPt.AdjustY(nWdt ); break;
+ case 3: aPt = rRectangle.BottomLeft(); aPt.AdjustX( -nWdt ); aPt.AdjustY(nWdt ); break;
}
- if (maGeo.nShearAngle) ShearPoint(aPt,maRect.TopLeft(),maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle) RotatePoint(aPt,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ if (maGeo.nShearAngle)
+ ShearPoint(aPt, rRectangle.TopLeft(),maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle)
+ RotatePoint(aPt, rRectangle.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
aPt-=GetSnapRect().Center();
SdrGluePoint aGP(aPt);
aGP.SetPercent(false);
@@ -526,7 +532,7 @@ SdrGluePoint SdrRectObj::GetCornerGluePoint(sal_uInt16 nPosNum) const
rtl::Reference<SdrObject> SdrRectObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
- XPolygon aXP(ImpCalcXPoly(maRect,GetEckenradius()));
+ XPolygon aXP(ImpCalcXPoly(getRectangle(), GetEckenradius()));
{ // TODO: this is only for the moment, until we have the new TakeContour()
aXP.Remove(0,1);
aXP[aXP.GetPointCount()-1]=aXP[0];
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 078e067aa14e..20e54ca976ac 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -101,7 +101,7 @@ SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrTextObj const & rSource)
// #i25616#
mbSupportTextIndentingOnLineWidthChange = true;
- maRect = rSource.maRect;
+ maRectangle = rSource.maRectangle;
maGeo = rSource.maGeo;
maTextSize = rSource.maTextSize;
@@ -135,7 +135,6 @@ SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrTextObj const & rSource)
SdrTextObj::SdrTextObj(SdrModel& rSdrModel, const tools::Rectangle& rNewRect)
: SdrAttrObj(rSdrModel)
- , maRect(rNewRect)
, mpEditingOutliner(nullptr)
, meTextKind(SdrObjKind::Text)
, maTextEditOffset(Point(0, 0))
@@ -147,7 +146,9 @@ SdrTextObj::SdrTextObj(SdrModel& rSdrModel, const tools::Rectangle& rNewRect)
, mbTextAnimationAllowed(true)
, mbInDownScale(false)
{
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(rNewRect);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
// #i25616#
mbSupportTextIndentingOnLineWidthChange = true;
@@ -173,7 +174,6 @@ SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrObjKind eNewTextKind)
SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrObjKind eNewTextKind,
const tools::Rectangle& rNewRect)
: SdrAttrObj(rSdrModel)
- , maRect(rNewRect)
, mpEditingOutliner(nullptr)
, meTextKind(eNewTextKind)
, maTextEditOffset(Point(0, 0))
@@ -185,7 +185,9 @@ SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrObjKind eNewTextKind,
, mbTextAnimationAllowed(true)
, mbInDownScale(false)
{
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(rNewRect);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
// #i25616#
mbSupportTextIndentingOnLineWidthChange = true;
@@ -199,14 +201,14 @@ SdrTextObj::~SdrTextObj()
void SdrTextObj::FitFrameToTextSize()
{
- ImpJustifyRect(maRect);
+ ImpJustifyRect(maRectangle);
SdrText* pText = getActiveText();
if(pText==nullptr || !pText->GetOutlinerParaObject())
return;
SdrOutliner& rOutliner=ImpGetDrawOutliner();
- rOutliner.SetPaperSize(Size(maRect.Right()-maRect.Left(),maRect.Bottom()-maRect.Top()));
+ rOutliner.SetPaperSize(Size(getRectangle().Right() - getRectangle().Left(), getRectangle().Bottom() - getRectangle().Top()));
rOutliner.SetUpdateLayout(true);
rOutliner.SetText(*pText->GetOutlinerParaObject());
Size aNewSize(rOutliner.CalcTextSize());
@@ -214,12 +216,12 @@ void SdrTextObj::FitFrameToTextSize()
aNewSize.AdjustWidth( 1 ); // because of possible rounding errors
aNewSize.AdjustWidth(GetTextLeftDistance()+GetTextRightDistance() );
aNewSize.AdjustHeight(GetTextUpperDistance()+GetTextLowerDistance() );
- tools::Rectangle aNewRect(maRect);
+ tools::Rectangle aNewRect(getRectangle());
aNewRect.SetSize(aNewSize);
ImpJustifyRect(aNewRect);
- if (aNewRect!=maRect) {
+
+ if (aNewRect != getRectangle())
SetLogicRect(aNewRect);
- }
}
void SdrTextObj::NbcSetText(const OUString& rStr)
@@ -523,7 +525,7 @@ void SdrTextObj::AdaptTextMinSize()
{
// Set minimum width.
const tools::Long nDist = GetTextLeftDistance() + GetTextRightDistance();
- const tools::Long nW = std::max<tools::Long>(0, maRect.GetWidth() - 1 - nDist); // text width without margins
+ const tools::Long nW = std::max<tools::Long>(0, getRectangle().GetWidth() - 1 - nDist); // text width without margins
aSet.Put(makeSdrTextMinFrameWidthItem(nW));
@@ -538,7 +540,7 @@ void SdrTextObj::AdaptTextMinSize()
{
// Set Minimum height.
const tools::Long nDist = GetTextUpperDistance() + GetTextLowerDistance();
- const tools::Long nH = std::max<tools::Long>(0, maRect.GetHeight() - 1 - nDist); // text height without margins
+ const tools::Long nH = std::max<tools::Long>(0, getRectangle().GetHeight() - 1 - nDist); // text height without margins
aSet.Put(makeSdrTextMinFrameHeightItem(nH));
@@ -610,7 +612,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle
void SdrTextObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
{
- rRect=maRect;
+ rRect = getRectangle();
}
// See also: <unnamed>::getTextAnchorRange in svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -649,7 +651,7 @@ void SdrTextObj::AdjustRectToTextDistance(tools::Rectangle& rAnchorRect) const
void SdrTextObj::TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const
{
- tools::Rectangle aAnkRect(maRect); // the rectangle in which we anchor
+ tools::Rectangle aAnkRect(getRectangle()); // the rectangle in which we anchor
bool bFrame=IsTextFrame();
if (!bFrame) {
TakeUnrotatedSnapRect(aAnkRect);
@@ -1090,9 +1092,11 @@ rtl::Reference<SdrObject> SdrTextObj::CloneSdrObject(SdrModel& rTargetModel) con
basegfx::B2DPolyPolygon SdrTextObj::TakeXorPoly() const
{
- tools::Polygon aPol(maRect);
- if (maGeo.nShearAngle) ShearPoly(aPol,maRect.TopLeft(),maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle) RotatePoly(aPol,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ tools::Polygon aPol(getRectangle());
+ if (maGeo.nShearAngle)
+ ShearPoly(aPol, getRectangle().TopLeft(), maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle)
+ RotatePoly(aPol, getRectangle().TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
basegfx::B2DPolyPolygon aRetval;
aRetval.append(aPol.getB2DPolygon());
@@ -1130,9 +1134,9 @@ void SdrTextObj::RecalcSnapRect()
{
if (maGeo.nRotationAngle || maGeo.nShearAngle)
{
- maSnapRect = Rect2Poly(maRect, maGeo).GetBoundRect();
+ maSnapRect = Rect2Poly(getRectangle(), maGeo).GetBoundRect();
} else {
- maSnapRect = maRect;
+ maSnapRect = getRectangle();
}
}
@@ -1144,15 +1148,18 @@ sal_uInt32 SdrTextObj::GetSnapPointCount() const
Point SdrTextObj::GetSnapPoint(sal_uInt32 i) const
{
Point aP;
+ auto aRectangle = getRectangle();
switch (i) {
- case 0: aP=maRect.TopLeft(); break;
- case 1: aP=maRect.TopRight(); break;
- case 2: aP=maRect.BottomLeft(); break;
- case 3: aP=maRect.BottomRight(); break;
- default: aP=maRect.Center(); break;
- }
- if (maGeo.nShearAngle) ShearPoint(aP,maRect.TopLeft(),maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle) RotatePoint(aP,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ case 0: aP = aRectangle.TopLeft(); break;
+ case 1: aP = aRectangle.TopRight(); break;
+ case 2: aP = aRectangle.BottomLeft(); break;
+ case 3: aP = aRectangle.BottomRight(); break;
+ default: aP = aRectangle.Center(); break;
+ }
+ if (maGeo.nShearAngle)
+ ShearPoint(aP, aRectangle.TopLeft(), maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle)
+ RotatePoint(aP, aRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
return aP;
}
@@ -1428,7 +1435,7 @@ void SdrTextObj::SaveGeoData(SdrObjGeoData& rGeo) const
{
SdrAttrObj::SaveGeoData(rGeo);
SdrTextObjGeoData& rTGeo=static_cast<SdrTextObjGeoData&>(rGeo);
- rTGeo.maRect = maRect;
+ rTGeo.maRect = getRectangle();
rTGeo.maGeo = maGeo;
}
@@ -1453,7 +1460,7 @@ drawing::TextFitToSizeType SdrTextObj::GetFitToSize() const
const tools::Rectangle& SdrTextObj::GetGeoRect() const
{
- return maRect;
+ return getRectangle();
}
void SdrTextObj::ForceOutlinerParaObject()
@@ -1586,7 +1593,7 @@ bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
double fShearX = toRadians(maGeo.nShearAngle);
// get aRect, this is the unrotated snaprect
- tools::Rectangle aRectangle(maRect);
+ tools::Rectangle aRectangle(getRectangle());
// fill other values
basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 49f7b2e79d2c..be87d5dd7577 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -240,7 +240,9 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt,
bool SdrTextObj::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
- bool bRet = AdjustTextFrameWidthAndHeight(maRect,bHgt,bWdt);
+ tools::Rectangle aRectangle(getRectangle());
+ bool bRet = AdjustTextFrameWidthAndHeight(aRectangle, bHgt, bWdt);
+ setRectangle(aRectangle);
if (bRet)
{
SetBoundAndSnapRectsDirty();
@@ -256,11 +258,11 @@ bool SdrTextObj::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
bool SdrTextObj::AdjustTextFrameWidthAndHeight()
{
- tools::Rectangle aNewRect(maRect);
- bool bRet=AdjustTextFrameWidthAndHeight(aNewRect);
+ tools::Rectangle aNewRect(getRectangle());
+ bool bRet = AdjustTextFrameWidthAndHeight(aNewRect);
if (bRet) {
tools::Rectangle aBoundRect0; if (m_pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
- maRect = aNewRect;
+ setRectangle(aNewRect);
SetBoundAndSnapRectsDirty();
if (auto pRectObj = dynamic_cast<SdrRectObj *>(this)) { // this is a hack
pRectObj->SetXPolyDirty();
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index a64da65dd1e9..c4a9046d0c0e 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -44,18 +44,21 @@ void SdrTextObj::AddToHdlList(SdrHdlList& rHdlList) const
{
Point aPnt;
SdrHdlKind eKind = SdrHdlKind::UpperLeft;
+ auto aRectangle = getRectangle();
switch (nHdlNum) {
- case 0: aPnt=maRect.TopLeft(); eKind=SdrHdlKind::UpperLeft; break;
- case 1: aPnt=maRect.TopCenter(); eKind=SdrHdlKind::Upper; break;
- case 2: aPnt=maRect.TopRight(); eKind=SdrHdlKind::UpperRight; break;
- case 3: aPnt=maRect.LeftCenter(); eKind=SdrHdlKind::Left ; break;
- case 4: aPnt=maRect.RightCenter(); eKind=SdrHdlKind::Right; break;
- case 5: aPnt=maRect.BottomLeft(); eKind=SdrHdlKind::LowerLeft; break;
- case 6: aPnt=maRect.BottomCenter(); eKind=SdrHdlKind::Lower; break;
- case 7: aPnt=maRect.BottomRight(); eKind=SdrHdlKind::LowerRight; break;
+ case 0: aPnt = aRectangle.TopLeft(); eKind=SdrHdlKind::UpperLeft; break;
+ case 1: aPnt = aRectangle.TopCenter(); eKind=SdrHdlKind::Upper; break;
+ case 2: aPnt = aRectangle.TopRight(); eKind=SdrHdlKind::UpperRight; break;
+ case 3: aPnt = aRectangle.LeftCenter(); eKind=SdrHdlKind::Left ; break;
+ case 4: aPnt = aRectangle.RightCenter(); eKind=SdrHdlKind::Right; break;
+ case 5: aPnt = aRectangle.BottomLeft(); eKind=SdrHdlKind::LowerLeft; break;
+ case 6: aPnt = aRectangle.BottomCenter(); eKind=SdrHdlKind::Lower; break;
+ case 7: aPnt = aRectangle.BottomRight(); eKind=SdrHdlKind::LowerRight; break;
}
- if (maGeo.nShearAngle) ShearPoint(aPnt,maRect.TopLeft(),maGeo.mfTanShearAngle);
- if (maGeo.nRotationAngle) RotatePoint(aPnt,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ if (maGeo.nShearAngle)
+ ShearPoint(aPnt, aRectangle.TopLeft(), maGeo.mfTanShearAngle);
+ if (maGeo.nRotationAngle)
+ RotatePoint(aPnt, aRectangle.TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
std::unique_ptr<SdrHdl> pH(new SdrHdl(aPnt,eKind));
pH->SetObj(const_cast<SdrTextObj*>(this));
pH->SetRotationAngle(maGeo.nRotationAngle);
@@ -71,7 +74,7 @@ bool SdrTextObj::hasSpecialDrag() const
tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
{
- tools::Rectangle aTmpRect(maRect);
+ tools::Rectangle aTmpRect(getRectangle());
const SdrHdl* pHdl=rDrag.GetHdl();
SdrHdlKind eHdl=pHdl==nullptr ? SdrHdlKind::Move : pHdl->GetKind();
bool bEcke=(eHdl==SdrHdlKind::UpperLeft || eHdl==SdrHdlKind::UpperRight || eHdl==SdrHdlKind::LowerLeft || eHdl==SdrHdlKind::LowerRight);
@@ -92,8 +95,8 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
if (bTop) aTmpRect.SetTop(aPos.Y() );
if (bBtm) aTmpRect.SetBottom(aPos.Y() );
if (bOrtho) { // Ortho
- tools::Long nWdt0=maRect.Right() -maRect.Left();
- tools::Long nHgt0=maRect.Bottom()-maRect.Top();
+ tools::Long nWdt0=getRectangle().Right() - getRectangle().Left();
+ tools::Long nHgt0=getRectangle().Bottom() - getRectangle().Top();
tools::Long nXMul=aTmpRect.Right() -aTmpRect.Left();
tools::Long nYMul=aTmpRect.Bottom()-aTmpRect.Top();
tools::Long nXDiv=nWdt0;
@@ -125,13 +128,13 @@ tools::Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
}
} else { // apex handles
if ((bLft || bRgt) && nXDiv!=0) {
- tools::Long nHgt0b=maRect.Bottom()-maRect.Top();
+ tools::Long nHgt0b=getRectangle().Bottom() - getRectangle().Top();
tools::Long nNeed=tools::Long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
aTmpRect.AdjustTop( -((nNeed-nHgt0b)/2) );
aTmpRect.SetBottom(aTmpRect.Top()+nNeed );
}
if ((bTop || bBtm) && nYDiv!=0) {
- tools::Long nWdt0b=maRect.Right()-maRect.Left();
+ tools::Long nWdt0b=getRectangle().Right() - getRectangle().Left();
tools::Long nNeed=tools::Long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
aTmpRect.AdjustLeft( -((nNeed-nWdt0b)/2) );
aTmpRect.SetRight(aTmpRect.Left()+nNeed );
@@ -150,20 +153,20 @@ bool SdrTextObj::applySpecialDrag(SdrDragStat& rDrag)
{
tools::Rectangle aNewRect(ImpDragCalcRect(rDrag));
- if(aNewRect.TopLeft() != maRect.TopLeft() && (maGeo.nRotationAngle || maGeo.nShearAngle))
+ if(aNewRect.TopLeft() != getRectangle().TopLeft() && (maGeo.nRotationAngle || maGeo.nShearAngle))
{
Point aNewPos(aNewRect.TopLeft());
if (maGeo.nShearAngle)
- ShearPoint(aNewPos,maRect.TopLeft(),maGeo.mfTanShearAngle);
+ ShearPoint(aNewPos, getRectangle().TopLeft(), maGeo.mfTanShearAngle);
if (maGeo.nRotationAngle)
- RotatePoint(aNewPos,maRect.TopLeft(),maGeo.mfSinRotationAngle,maGeo.mfCosRotationAngle);
+ RotatePoint(aNewPos, getRectangle().TopLeft(), maGeo.mfSinRotationAngle, maGeo.mfCosRotationAngle);
aNewRect.SetPos(aNewPos);
}
- if (aNewRect != maRect)
+ if (aNewRect != getRectangle())
{
NbcSetLogicRect(aNewRect);
}
@@ -185,7 +188,7 @@ bool SdrTextObj::BegCreate(SdrDragStat& rStat)
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
aRect1.Normalize();
rStat.SetActionRect(aRect1);
- maRect = aRect1;
+ setRectangle(aRect1);
return true;
}
@@ -195,7 +198,7 @@ bool SdrTextObj::MovCreate(SdrDragStat& rStat)
rStat.TakeCreateRect(aRect1);
ImpJustifyRect(aRect1);
rStat.SetActionRect(aRect1);
- maRect = aRect1; // for ObjName
+ setRectangle(aRect1); // for ObjName
SetBoundRectDirty();
m_bSnapRectDirty=true;
if (auto pRectObj = dynamic_cast<SdrRectObj *>(this)) {
@@ -206,8 +209,10 @@ bool SdrTextObj::MovCreate(SdrDragStat& rStat)
bool SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- rStat.TakeCreateRect(maRect);
- ImpJustifyRect(maRect);
+ tools::Rectangle aRectangle(getRectangle());
+ rStat.TakeCreateRect(aRectangle);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
AdaptTextMinSize();
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index ed25418c930d..5c9f28f5115c 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -57,8 +57,8 @@ void SdrTextObj::NbcSetSnapRect(const tools::Rectangle& rRect)
{
// No rotation or shear.
- maRect = rRect;
- ImpJustifyRect(maRect);
+ setRectangle(rRect);
+ ImpJustifyRect(maRectangle);
AdaptTextMinSize();
@@ -69,13 +69,13 @@ void SdrTextObj::NbcSetSnapRect(const tools::Rectangle& rRect)
const tools::Rectangle& SdrTextObj::GetLogicRect() const
{
- return maRect;
+ return getRectangle();
}
void SdrTextObj::NbcSetLogicRect(const tools::Rectangle& rRect)
{
- maRect = rRect;
- ImpJustifyRect(maRect);
+ setRectangle(rRect);
+ ImpJustifyRect(maRectangle);
AdaptTextMinSize();
@@ -94,7 +94,7 @@ Degree100 SdrTextObj::GetShearAngle(bool /*bVertical*/) const
void SdrTextObj::NbcMove(const Size& rSize)
{
- maRect.Move(rSize);
+ moveRectangle(rSize.Width(), rSize.Height());
moveOutRectangle(rSize.Width(), rSize.Height());
maSnapRect.Move(rSize);
SetBoundAndSnapRectsDirty(true);
@@ -121,17 +121,20 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
}
if (maGeo.nRotationAngle==0_deg100 && maGeo.nShearAngle==0_deg100) {
- ResizeRect(maRect,rRef,xFact,yFact);
- if (bYMirr) {
- maRect.Normalize();
- maRect.Move(maRect.Right()-maRect.Left(),maRect.Bottom()-maRect.Top());
+ auto aRectangle = getRectangle();
+ ResizeRect(aRectangle, rRef, xFact, yFact);
+ setRectangle(aRectangle);
+ if (bYMirr)
+ {
+ maRectangle.Normalize();
+ moveRectangle(aRectangle.Right() - aRectangle.Left(), aRectangle.Bottom() - aRectangle.Top());
maGeo.nRotationAngle=18000_deg100;
maGeo.RecalcSinCos();
}
}
else
{
- tools::Polygon aPol(Rect2Poly(maRect,maGeo));
+ tools::Polygon aPol(Rect2Poly(getRectangle(), maGeo));
for(sal_uInt16 a(0); a < aPol.GetSize(); a++)
{
@@ -149,8 +152,9 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
aPol[3] = aPol0[2];
aPol[4] = aPol0[1];
}
-
- Poly2Rect(aPol, maRect, maGeo);
+ tools::Rectangle aRectangle(getRectangle());
+ Poly2Rect(aPol, aRectangle, maGeo);
+ setRectangle(aRectangle);
}
if (bRotate90) {
@@ -171,7 +175,7 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
}
}
- ImpJustifyRect(maRect);
+ ImpJustifyRect(maRectangle);
AdaptTextMinSize();
@@ -187,14 +191,14 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
void SdrTextObj::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
{
SetGlueReallyAbsolute(true);
- tools::Long dx=maRect.Right()-maRect.Left();
- tools::Long dy=maRect.Bottom()-maRect.Top();
- Point aP(maRect.TopLeft());
- RotatePoint(aP,rRef,sn,cs);
- maRect.SetLeft(aP.X() );
- maRect.SetTop(aP.Y() );
- maRect.SetRight(maRect.Left()+dx );
- maRect.SetBottom(maRect.Top()+dy );
+ tools::Long dx = getRectangle().Right() - getRectangle().Left();
+ tools::Long dy = getRectangle().Bottom() - getRectangle().Top();
+ Point aPoint1(getRectangle().TopLeft());
+ RotatePoint(aPoint1, rRef, sn, cs);
+ Point aPoint2(aPoint1.X() + dx, aPoint1.Y() + dy);
+ tools::Rectangle aRectangle(aPoint1, aPoint2);
+ setRectangle(aRectangle);
+
if (maGeo.nRotationAngle==0_deg100) {
maGeo.nRotationAngle=NormAngle36000(nAngle);
maGeo.mfSinRotationAngle=sn;
@@ -213,14 +217,17 @@ void SdrTextObj::NbcShear(const Point& rRef, Degree100 /*nAngle*/, double tn, bo
SetGlueReallyAbsolute(true);
// when this is a SdrPathObj, aRect may be uninitialized
- tools::Polygon aPol(Rect2Poly(maRect.IsEmpty() ? GetSnapRect() : maRect, maGeo));
+ tools::Polygon aPol(Rect2Poly(getRectangle().IsEmpty() ? GetSnapRect() : getRectangle(), maGeo));
sal_uInt16 nPointCount=aPol.GetSize();
for (sal_uInt16 i=0; i<nPointCount; i++) {
ShearPoint(aPol[i],rRef,tn,bVShear);
}
- Poly2Rect(aPol,maRect,maGeo);
- ImpJustifyRect(maRect);
+ auto aRectangle = getRectangle();
+ Poly2Rect(aPol, aRectangle, maGeo);
+ setRectangle(aRectangle);
+ ImpJustifyRect(maRectangle);
+
if (mbTextFrame) {
NbcAdjustTextFrameWidthAndHeight();
}
@@ -240,7 +247,7 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2)
std::abs(rRef1.X()-rRef2.X())==std::abs(rRef1.Y()-rRef2.Y()))) {
bRotate90=maGeo.nRotationAngle.get() % 9000 ==0;
}
- tools::Polygon aPol(Rect2Poly(maRect,maGeo));
+ tools::Polygon aPol(Rect2Poly(getRectangle(),maGeo));
sal_uInt16 i;
sal_uInt16 nPointCount=aPol.GetSize();
for (i=0; i<nPointCount; i++) {
@@ -253,7 +260,9 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2)
aPol[2]=aPol0[3];
aPol[3]=aPol0[2];
aPol[4]=aPol0[1];
- Poly2Rect(aPol,maRect,maGeo);
+ tools::Rectangle aRectangle = getRectangle();
+ Poly2Rect(aPol, aRectangle, maGeo);
+ setRectangle(aRectangle);
if (bRotate90) {
bool bRota90=maGeo.nRotationAngle.get() % 9000 ==0;
@@ -273,7 +282,7 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2)
maGeo.RecalcTan();
}
- ImpJustifyRect(maRect);
+ ImpJustifyRect(maRectangle);
if (mbTextFrame) {
NbcAdjustTextFrameWidthAndHeight();
}
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 82832c98b620..6ea734a7341c 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -297,7 +297,7 @@ void SdrUnoObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti
// small correctors
if (maGeo.nRotationAngle>=9000_deg100 && maGeo.nRotationAngle<27000_deg100)
{
- maRect.Move(maRect.Left()-maRect.Right(),maRect.Top()-maRect.Bottom());
+ moveRectangle(getRectangle().Left() - getRectangle().Right(), getRectangle().Top() - getRectangle().Bottom());
}
maGeo.nRotationAngle = 0_deg100;
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 957aa62a190a..25ab8715d307 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -301,7 +301,9 @@ void SdrTableObjImpl::CropTableModelToSelection(const CellPos& rStart, const Cel
ApplyCellStyles();
// layout cropped table
- LayoutTable( mpTableObj->maRect, false, false );
+ auto aRectangle = mpTableObj->getRectangle();
+ LayoutTable(aRectangle, false, false);
+ mpTableObj->setRectangle(aRectangle);
}
void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 nRows )
@@ -312,8 +314,10 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n
Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(this) );
mxTable->addModifyListener( xListener );
mpLayouter.reset(new TableLayouter( mxTable ));
- LayoutTable( mpTableObj->maRect, true, true );
- mpTableObj->maLogicRect = mpTableObj->maRect;
+ auto aRectangle = mpTableObj->getRectangle();
+ LayoutTable(aRectangle, true, true);
+ mpTableObj->setRectangle(aRectangle);
+ mpTableObj->maLogicRect = aRectangle;
}
@@ -404,10 +408,12 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
ApplyCellStyles();
// copy geometry
- mpTableObj->maRect = mpTableObj->maLogicRect;
+ mpTableObj->setRectangle(mpTableObj->maLogicRect);
// layout cloned table
- LayoutTable( mpTableObj->maRect, false, false );
+ auto aRectangle = mpTableObj->getRectangle();
+ LayoutTable(aRectangle, false, false);
+ mpTableObj->setRectangle(aRectangle);
// re-connect to styles (evtl. in new SdrModel)
connectTableStyle();
@@ -634,8 +640,10 @@ void SdrTableObjImpl::update()
ApplyCellStyles();
- mpTableObj->maRect = mpTableObj->maLogicRect;
- LayoutTable( mpTableObj->maRect, false, false );
+ mpTableObj->setRectangle(mpTableObj->maLogicRect);
+ auto aRectangle = mpTableObj->getRectangle();
+ LayoutTable(aRectangle, false, false);
+ mpTableObj->setRectangle(aRectangle);
mpTableObj->SetBoundAndSnapRectsDirty();
mpTableObj->ActionChanged();
@@ -834,7 +842,7 @@ SdrTableObj::SdrTableObj(SdrModel& rSdrModel, SdrTableObj const & rSource)
TableModelNotifyGuard aGuard( mpImpl.is() ? mpImpl->mxTable.get() : nullptr );
maLogicRect = rSource.maLogicRect;
- maRect = rSource.maRect;
+ maRectangle = rSource.maRectangle;
maGeo = rSource.maGeo;
meTextKind = rSource.meTextKind;
mbTextFrame = rSource.mbTextFrame;
@@ -882,8 +890,10 @@ void SdrTableObj::init( sal_Int32 nColumns, sal_Int32 nRows )
// Stuff done from old SetModel:
if( !maLogicRect.IsEmpty() )
{
- maRect = maLogicRect;
- mpImpl->LayoutTable( maRect, false, false );
+ setRectangle(maLogicRect);
+ auto aRectangle = getRectangle();
+ mpImpl->LayoutTable(aRectangle, false, false);
+ setRectangle(aRectangle);
}
}
@@ -1158,10 +1168,10 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
const sal_Int32 nColCount = mpImpl->getColumnCount();
const sal_Int32 nRowCount = mpImpl->getRowCount();
- sal_Int32 nX = rPos.X() - maRect.Left();
- sal_Int32 nY = rPos.Y() - maRect.Top();
+ sal_Int32 nX = rPos.X() - getRectangle().Left();
+ sal_Int32 nY = rPos.Y() - getRectangle().Top();
- if( (nX < 0) || (nX > maRect.GetWidth()) || (nY < 0) || (nY > maRect.GetHeight() ) )
+ if( (nX < 0) || (nX > getRectangle().GetWidth()) || (nY < 0) || (nY > getRectangle().GetHeight() ) )
return TableHitKind::NONE;
// get vertical edge number and check for a hit
@@ -1406,13 +1416,15 @@ void SdrTableObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
{
if( (pEditStatus->GetStatusWord() & EditStatusFlags::TextHeightChanged) && mpImpl.is() && mpImpl->mpLayouter )
{
- tools::Rectangle aRect0( maRect );
- maRect = maLogicRect;
- mpImpl->LayoutTable( maRect, false, false );
+ tools::Rectangle aRect0(getRectangle());
+ setRectangle(maLogicRect);
+ auto aRectangle = getRectangle();
+ mpImpl->LayoutTable(aRectangle, false, false);
+ setRectangle(aRectangle);
SetBoundAndSnapRectsDirty();
ActionChanged();
BroadcastObjectChange();
- if (aRect0 != maRect)
+ if (aRect0 != getRectangle())
SendUserCall(SdrUserCallType::Resize,aRect0);
}
}
@@ -1619,7 +1631,7 @@ void SdrTableObj::TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const
void SdrTableObj::TakeTextAnchorRect( const CellPos& rPos, tools::Rectangle& rAnchorRect ) const
{
- tools::Rectangle aAnkRect(maRect);
+ tools::Rectangle aAnkRect(getRectangle());
if( mpImpl.is() )
{
@@ -1746,7 +1758,7 @@ rtl::Reference<SdrObject> SdrTableObj::CloneSdrObject(SdrModel& rTargetModel) co
const tools::Rectangle& SdrTableObj::GetSnapRect() const
{
- return maRect;
+ return getRectangle();
}
@@ -1881,9 +1893,9 @@ void SdrTableObj::NbcSetLogicRect(const tools::Rectangle& rRect)
{
maLogicRect=rRect;
ImpJustifyRect(maLogicRect);
- const bool bWidth = maLogicRect.getOpenWidth() != maRect.getOpenWidth();
- const bool bHeight = maLogicRect.getOpenHeight() != maRect.getOpenHeight();
- maRect = maLogicRect;
+ const bool bWidth = maLogicRect.getOpenWidth() != getRectangle().getOpenWidth();
+ const bool bHeight = maLogicRect.getOpenHeight() != getRectangle().getOpenHeight();
+ setRectangle(maLogicRect);
if (mpImpl->mbSkipChangeLayout)
// Avoid distributing newly available space between existing cells.
NbcAdjustTextFrameWidthAndHeight();
@@ -1906,7 +1918,7 @@ void SdrTableObj::NbcMove(const Size& rSiz)
maLogicRect.Move(rSiz);
SdrTextObj::NbcMove( rSiz );
if( mpImpl.is() )
- mpImpl->UpdateCells( maRect );
+ mpImpl->UpdateCells(getRectangle());
}
@@ -1915,7 +1927,7 @@ void SdrTableObj::NbcResize(const Point& rRef, const Fraction& xFact, const Frac
tools::Rectangle aOldRect( maLogicRect );
ResizeRect(maLogicRect,rRef,xFact,yFact);
- maRect = maLogicRect;
+ setRectangle(maLogicRect);
NbcAdjustTextFrameWidthAndHeight( maLogicRect.GetHeight() == aOldRect.GetHeight(), maLogicRect.GetWidth() == aOldRect.GetWidth() );
SetBoundAndSnapRectsDirty();
}
@@ -1930,7 +1942,7 @@ bool SdrTableObj::AdjustTextFrameWidthAndHeight()
tools::Rectangle aBoundRect0;
if (m_pUserCall!=nullptr)
aBoundRect0=GetLastBoundRect();
- maRect = aNewRect;
+ setRectangle(aNewRect);
SetBoundAndSnapRectsDirty();
SetChanged();
BroadcastObjectChange();
@@ -2049,7 +2061,7 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
std::vector<TableEdgeHdl*> aRowEdges(nRowCount + 1);
for (auto const & rEdge : mpImpl->mpLayouter->getHorizontalEdges())
{
- Point aPoint(maRect.TopLeft());
+ Point aPoint(getRectangle().TopLeft());
aPoint.AdjustY(rEdge.nPosition);
std::unique_ptr<TableEdgeHdl> pHdl(new TableEdgeHdl(aPoint, true, rEdge.nMin, rEdge.nMax, nColCount + 1));
@@ -2062,7 +2074,7 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
std::vector<TableEdgeHdl*> aColEdges(nColCount + 1);
for (auto const & rEdge : mpImpl->mpLayouter->getVerticalEdges())
{
- Point aPoint(maRect.TopLeft());
+ Point aPoint(getRectangle().TopLeft());
aPoint.AdjustX(rEdge.nPosition);
std::unique_ptr<TableEdgeHdl> pHdl(new TableEdgeHdl(aPoint, false, rEdge.nMin, rEdge.nMax, nRowCount + 1));
@@ -2108,15 +2120,16 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
// add remaining handles
SdrHdlList tempList(nullptr);
- tempList.AddHdl( std::make_unique<TableBorderHdl>( maRect, !IsTextEditActive() ) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.TopLeft(),SdrHdlKind::UpperLeft) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.TopCenter(),SdrHdlKind::Upper) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.TopRight(),SdrHdlKind::UpperRight) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.LeftCenter(),SdrHdlKind::Left) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.RightCenter(),SdrHdlKind::Right) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.BottomLeft(),SdrHdlKind::LowerLeft) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.BottomCenter(),SdrHdlKind::Lower) );
- tempList.AddHdl( std::make_unique<SdrHdl>(maRect.BottomRight(),SdrHdlKind::LowerRight) );
+ auto aRectangle = getRectangle();
+ tempList.AddHdl( std::make_unique<TableBorderHdl>(aRectangle, !IsTextEditActive() ) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.TopLeft(),SdrHdlKind::UpperLeft) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.TopCenter(),SdrHdlKind::Upper) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.TopRight(),SdrHdlKind::UpperRight) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.LeftCenter(),SdrHdlKind::Left) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.RightCenter(),SdrHdlKind::Right) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.BottomLeft(),SdrHdlKind::LowerLeft) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.BottomCenter(),SdrHdlKind::Lower) );
+ tempList.AddHdl( std::make_unique<SdrHdl>(aRectangle.BottomRight(),SdrHdlKind::LowerRight) );
for( size_t nHdl = 0; nHdl < tempList.GetHdlCount(); ++nHdl )
tempList.GetHdl(nHdl)->SetMoveOutside(true);
tempList.MoveTo(rHdlList);
@@ -2188,7 +2201,7 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
{
const tools::Rectangle aNewRectangle(ImpDragCalcRect(rDrag));
- if (aNewRectangle != maRect)
+ if (aNewRectangle != getRectangle())
{
NbcSetLogicRect(aNewRectangle);
}
@@ -2258,7 +2271,7 @@ bool SdrTableObj::BegCreate(SdrDragStat& rStat)
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
aRect1.Normalize();
rStat.SetActionRect(aRect1);
- maRect = aRect1;
+ setRectangle(aRect1);
return true;
}
@@ -2269,7 +2282,7 @@ bool SdrTableObj::MovCreate(SdrDragStat& rStat)
rStat.TakeCreateRect(aRect1);
ImpJustifyRect(aRect1);
rStat.SetActionRect(aRect1);
- maRect = aRect1; // for ObjName
+ setRectangle(aRect1); // for ObjName
SetBoundRectDirty();
m_bSnapRectDirty=true;
return true;
@@ -2278,8 +2291,10 @@ bool SdrTableObj::MovCreate(SdrDragStat& rStat)
bool SdrTableObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- rStat.TakeCreateRect(maRect);
- ImpJustifyRect(maRect);
+ auto aRectangle = getRectangle();
+ rStat.TakeCreateRect(aRectangle);
+ ImpJustifyRect(aRectangle);
+ setRectangle(aRectangle);
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
}
@@ -2343,7 +2358,11 @@ void SdrTableObj::RestoreGeoData(const SdrObjGeoData& rGeo)
SdrTextObj::RestoreGeoData (rGeo);
if( mpImpl.is() )
- mpImpl->LayoutTable(maRect, false, false);
+ {
+ auto aRectangle = getRectangle();
+ mpImpl->LayoutTable(aRectangle, false, false);
+ setRectangle(aRectangle);
+ }
ActionChanged();
}
@@ -2370,7 +2389,9 @@ void SdrTableObj::DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColu
if( mpImpl.is() && mpImpl->mpLayouter )
{
TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
- mpImpl->mpLayouter->DistributeColumns( maRect, nFirstColumn, nLastColumn, bOptimize, bMinimize );
+ auto aRectangle = getRectangle();
+ mpImpl->mpLayouter->DistributeColumns(aRectangle, nFirstColumn, nLastColumn, bOptimize, bMinimize);
+ setRectangle(aRectangle);
}
}
@@ -2380,7 +2401,9 @@ void SdrTableObj::DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow, const
if( mpImpl.is() && mpImpl->mpLayouter )
{
TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
- mpImpl->mpLayouter->DistributeRows( maRect, nFirstRow, nLastRow, bOptimize, bMinimize );
+ auto aRectangle = getRectangle();
+ mpImpl->mpLayouter->DistributeRows(aRectangle, nFirstRow, nLastRow, bOptimize, bMinimize);
+ setRectangle(aRectangle);
}
}
@@ -2389,7 +2412,9 @@ void SdrTableObj::SetChanged()
{
if( mpImpl.is() )
{
- mpImpl->LayoutTable( maRect, false, false );
+ auto aRectangle = getRectangle();
+ mpImpl->LayoutTable(aRectangle, false, false);
+ setRectangle(aRectangle);
}
::SdrTextObj::SetChanged();