28#include <svx/strings.hrc>
33#include <osl/diagnose.h>
41 return std::make_unique<sdr::properties::RectangleProperties>(*
this);
49 return std::make_unique<sdr::contact::ViewContactOfSdrRectObj>(*
this);
81 "SdrRectObj::SdrRectObj(SdrObjKind) can only be applied to text frames.");
93 "SdrRectObj::SdrRectObj(SdrObjKind,...) can only be applied to text frames.");
108 XPolygon aXPoly(rRect1,nRad1,nRad1);
111 sal_uInt16 nShift=nPointCnt-2;
112 if (nRad1!=0) nShift=nPointCnt-5;
114 for (sal_uInt16
i=1;
i<nPointCnt;
i++) {
115 aNewPoly[
i]=aXPoly[j];
118 if (j>=nPointCnt) j=1;
121 aNewPoly[nPointCnt]=aNewPoly[0];
163 if (bCanConv && !bNoTextFrame && !
HasText()) {
192 rRect.
Move(aTmpPt.
X(),aTmpPt.
Y());
208 TranslateId pResId = bRounded ? STR_ObjNameSingulRECTRND : STR_ObjNameSingulRECT;
211 pResId = bRounded ? STR_ObjNameSingulPARALRND : STR_ObjNameSingulPARAL;
215 pResId = bRounded ? STR_ObjNameSingulQUADRND : STR_ObjNameSingulQUAD;
220 if (!
aName.isEmpty())
234 TranslateId pResId = bRounded ? STR_ObjNamePluralRECTRND : STR_ObjNamePluralRECT;
237 pResId = bRounded ? STR_ObjNamePluralPARALRND : STR_ObjNamePluralPARAL;
241 pResId = bRounded ? STR_ObjNamePluralQUADRND : STR_ObjNamePluralQUAD;
291 OSL_ENSURE(!
IsTextEditActive(),
"Do not use an ImpTextframeHdl for highlighting text in active text edit, this will collide with EditEngine paints (!)");
295 rHdlList.
AddHdl(std::move(pH));
298 for(sal_Int32 nHdlNum = 1; nHdlNum <= 9; ++nHdlNum)
308 tools::Long b = std::max(rRectangle.GetWidth(), rRectangle.GetHeight())/2;
311 aPnt = rRectangle.TopLeft();
335 std::unique_ptr<SdrHdl> pH(
new SdrHdl(aPnt,eKind));
338 rHdlList.
AddHdl(std::move(pH));
442 return PointerStyle::DrawRect;
489 case 0: aPt = rRectangle.TopCenter(); aPt.
AdjustY( -nWdt );
break;
490 case 1: aPt = rRectangle.RightCenter(); aPt.
AdjustX(nWdt );
break;
491 case 2: aPt = rRectangle.BottomCenter(); aPt.
AdjustY(nWdt );
break;
492 case 3: aPt = rRectangle.LeftCenter(); aPt.
AdjustX( -nWdt );
break;
518 case 0: aPt = rRectangle.TopLeft(); aPt.
AdjustX( -nWdt ); aPt.
AdjustY( -nWdt );
break;
519 case 1: aPt = rRectangle.TopRight(); aPt.
AdjustX(nWdt ); aPt.
AdjustY( -nWdt );
break;
520 case 2: aPt = rRectangle.BottomRight(); aPt.
AdjustX(nWdt ); aPt.
AdjustY(nWdt );
break;
521 case 3: aPt = rRectangle.BottomLeft(); aPt.
AdjustX( -nWdt ); aPt.
AdjustY(nWdt );
break;
double mfCosRotationAngle
double mfSinRotationAngle
Degree100 m_nRotationAngle
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
virtual const tools::Rectangle & GetSnapRect() const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
sal_Int32 ImpGetLineWdt() const
Detects the width of the line. No line ->0.
tools::Rectangle maSnapRect
SdrObject * GetCreateObj() const
void TakeCreateRect(tools::Rectangle &rRect) const
SdrView * GetView() const
const SdrHdl * GetHdl() const
const Point & GetNow() const
void SetEndDragChangesAttributes(bool bOn)
void SetPercent(bool bOn)
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdlKind GetKind() const
All geometrical data of an arbitrary object for use in undo/redo.
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
bool LineGeometryUsageIsNecessary() const
bool LineIsOutsideGeometry() const
virtual const OUString & GetName() const
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
OUString GetMetrStr(tools::Long nVal) const
Rectangle objects (rectangle, circle, ...)
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const override
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
XPolygon ImpCalcXPoly(const tools::Rectangle &rRect1, tools::Long nRad1) const
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
virtual ~SdrRectObj() override
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override
virtual void RecalcXPoly()
Subclasses should override RecalcXPoly() by creating an XPolygon instance with new and assigning it t...
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
virtual SdrObjKind GetObjIdentifier() const override
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override
virtual OUString TakeObjNamePlural() const override
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
virtual OUString TakeObjNameSingul() const override
const XPolygon & GetXPoly() const
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
std::optional< XPolygon > mpXPoly
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
tools::Rectangle const & getRectangle() const
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
bool IsTextEditActive() const
virtual OUString TakeObjNameSingul() const override
void NbcSetEckenradius(tools::Long nRad)
rtl::Reference< SdrPathObj > ImpConvertMakeObj(const basegfx::B2DPolyPolygon &rPolyPolygon, bool bClosed, bool bBezier) const
virtual OUString TakeObjNamePlural() const override
bool ImpCanConvTextToCurve() const
virtual bool HasText() const override
tools::Long GetEckenradius() const
rtl::Reference< SdrObject > ImpConvertAddText(rtl::Reference< SdrObject > pObj, bool bBezier) const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
basegfx::B2DPolyPolygon getB2DPolyPolygon() const
void Insert(XPolygon &&rXPoly)
void Remove(sal_uInt16 nPos, sal_uInt16 nCount)
sal_uInt16 GetPointCount() const
void SetFlags(sal_uInt16 nPos, PolyFlags eFlags)
set the flags for the point at the given position
basegfx::B2DPolygon getB2DPolygon() const
PolyFlags GetFlags(sal_uInt16 nPos) const
get the flags for the point at the given position
tools::Rectangle GetBoundRect() const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void removeDoublePoints()
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
tools::Long FRound(double fVal)
UNDERLYING_TYPE get() const
@ Text
closed free-hand line
@ OutlineText
TitleText, special text object for StarDraw.
void ShearXPoly(XPolygon &rPoly, const Point &rRef, double tn, bool bVShear)
void RotateXPoly(XPolygon &rPoly, const Point &rRef, double sn, double cs)
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)