21#include <config_features.h>
26#include <com/sun/star/lang/XComponent.hpp>
27#include <com/sun/star/text/RelOrientation.hpp>
28#include <com/sun/star/frame/XTerminateListener.hpp>
29#include <com/sun/star/frame/Desktop.hpp>
41#include <editeng/editeng.hxx>
86#include <svx/strings.hrc>
117#include <unordered_set>
120#include <libxml/xmlwriter.h>
124#include <rtl/character.hxx>
155 nInventor(rData.nInventor),
156 nIdentifier(rData.nIdentifier) {}
176 bResizeFreeAllowed(true),
177 bResizePropAllowed(true),
178 bRotateFreeAllowed(true),
179 bRotate90Allowed(true),
180 bMirrorFreeAllowed(true),
181 bMirror45Allowed(true),
182 bMirror90Allowed(true),
183 bTransparenceAllowed(true),
185 bEdgeRadiusAllowed(true),
186 bNoOrthoDesired(true),
188 bCanConvToPath(true),
189 bCanConvToPoly(true),
190 bCanConvToContour(false),
191 bCanConvToPathLineToArea(true),
192 bCanConvToPolyLineToArea(true) {}
209 static std::shared_ptr< svx::diagram::IDiagramHelper > aEmpty;
217 return std::make_unique<sdr::properties::EmptyProperties>(*
this);
240 mpImpl->maObjectUsers.push_back(&rNewUser);
245 const sdr::ObjectUserVector::iterator aFindResult =
246 std::find(
mpImpl->maObjectUsers.begin(),
mpImpl->maObjectUsers.end(), &rOldUser);
247 if (aFindResult !=
mpImpl->maObjectUsers.end())
249 mpImpl->maObjectUsers.erase(aFindResult);
258 return std::make_unique<sdr::contact::ViewContactOfSdrObj>(*
this);
300 assert(
bool(
mpParentOfSdrObject) !=
bool(pNewObjList) &&
"may only transition empty->full or full->empty");
312 if(pOldPage != pNewPage)
344 assert(
false &&
"SdrObject::~SdrObject: Destructed incarnation of SdrObject not member of this SdrModel (!)");
350: mpFillGeometryDefiningShape(nullptr)
351 ,mrSdrModelFromSdrObject(rSdrModel)
352 ,m_pUserCall(nullptr)
354 ,mpParentOfSdrObject(nullptr)
358 ,mpSvxShape( nullptr )
359 ,mbDoNotInsertIntoPageAutomatically(false)
388: mpFillGeometryDefiningShape(nullptr)
389 ,mrSdrModelFromSdrObject(rSdrModel)
390 ,m_pUserCall(nullptr)
392 ,mpParentOfSdrObject(nullptr)
396 ,mpSvxShape( nullptr )
397 ,mbDoNotInsertIntoPageAutomatically(false)
467 aList.swap(
mpImpl->maObjectUsers);
470 DBG_ASSERT(pObjectUser,
"SdrObject::~SdrObject: corrupt ObjectUser list (!)");
471 pObjectUser->ObjectInDestruction(*
this);
497 oslInterlockedCount
x = osl_atomic_decrement( &
m_refCount );
534class TerminateListener :
public ::cppu::WeakImplHelper< css::frame::XTerminateListener >
536 void SAL_CALL queryTermination(
const lang::EventObject& )
override
538 void SAL_CALL notifyTermination(
const lang::EventObject& )
override
542 virtual void SAL_CALL disposing( const ::css::lang::EventObject& )
override
562 uno::Reference< frame::XTerminateListener > xListener(
new TerminateListener );
563 xDesktop->addTerminateListener( xListener );
577 mpImpl->meRelativeWidthRelation = eValue;
587 mpImpl->meRelativeHeightRelation = eValue;
592 if (!
mpImpl->mnRelativeWidth)
595 return &*
mpImpl->mnRelativeWidth;
600 return mpImpl->meRelativeWidthRelation;
605 if (!
mpImpl->mnRelativeHeight)
608 return &*
mpImpl->mnRelativeHeight;
613 return mpImpl->meRelativeHeightRelation;
658 for (
size_t nObjNum = 0; nObjNum<nObjCount; ++nObjNum)
726 if(
nullptr == pParent)
749 std::unique_ptr<SdrUndoAction> pUndoAction =
773 static const OUString
EMPTY =
u"";
798 std::unique_ptr<SdrUndoAction> pUndoAction =
842 std::unique_ptr<SdrUndoAction> pUndoAction =
882 std::unique_ptr<SdrUndoAction> pUndoAction(
909 if (pParentList->IsObjOrdNumsDirty())
911 pParentList->RecalcObjOrdNums();
927 rVal <<= uno::Sequence<beans::PropertyValue>();
965 if (rRectangle.IsEmpty())
991 if (!rRectangle.IsEmpty())
999 if (xPrimitives.empty())
1026 if(!(bPlusDataBroadcast || bObjectChange))
1031 if(bPlusDataBroadcast)
1067 aObjectVector.push_back(
const_cast< SdrObject*
>(
this));
1078 return (eXLS != drawing::LineStyle_NONE);
1092 if (!
aName.isEmpty())
1099 return SvxResId(STR_ObjNamePluralNONE);
1105 sal_Int32
nPos =
aStr.indexOf(
"%1");
1156 pClone->SetOutlinerParaObject(std::nullopt);
1170 pClone->ConnectToNode(
true, pLeft);
1175 pClone->ConnectToNode(
false, pRight);
1190 pClone->SetMergedItemSet(aNewSet);
1197 if(!xSequence.empty())
1204 aExtractor.
process(xSequence);
1206 const sal_uInt32 nSize(rResult.size());
1215 for(sal_uInt32
a(0);
a < nSize;
a++)
1234 for (sal_uInt32 nHdlNum=0; nHdlNum<8; ++nHdlNum)
1236 std::unique_ptr<SdrHdl> pH;
1247 rHdlList.
AddHdl(std::move(pH));
1275 if (bLft) aTmpRect.
SetLeft(aPos.
X() );
1277 if (bTop) aTmpRect.
SetTop(aPos.
Y() );
1286 bool bXNeg=(nXMul<0)!=(nXDiv<0);
1287 bool bYNeg=(nYMul<0)!=(nYDiv<0);
1288 nXMul=std::abs(nXMul);
1289 nYMul=std::abs(nYMul);
1290 nXDiv=std::abs(nXDiv);
1291 nYDiv=std::abs(nYDiv);
1299 bool bUseX=(aXFact<aYFact) != bBigOrtho;
1302 if (bYNeg) nNeed=-nNeed;
1307 if (bXNeg) nNeed=-nNeed;
1312 if ((bLft || bRgt) && nXDiv!=0) {
1315 aTmpRect.
AdjustTop( -((nNeed-nHgt0b)/2) );
1318 if ((bTop || bBtm) && nYDiv!=0) {
1435 return PointerStyle::Cross;
1449 if (bXMirr || bYMirr) {
1483 aRectangle.Move(-rRef1.
X(),-rRef1.
Y());
1488 aRectangle.SetLeft(-
R.Right() );
1489 aRectangle.SetRight(-
R.Left() );
1491 aRectangle.SetTop(-
R.Bottom() );
1492 aRectangle.SetBottom(-
R.Top() );
1493 }
else if (dx==dy) {
1494 aRectangle.SetLeft(
R.Top() );
1495 aRectangle.SetRight(
R.Bottom() );
1496 aRectangle.SetTop(
R.Left() );
1497 aRectangle.SetBottom(
R.Right() );
1498 }
else if (dx==-dy) {
1499 aRectangle.SetLeft(-
R.Bottom() );
1500 aRectangle.SetRight(-
R.Top() );
1501 aRectangle.SetTop(-
R.Right() );
1502 aRectangle.SetBottom(-
R.Left() );
1504 aRectangle.Move(rRef1.
X(),rRef1.
Y());
1505 aRectangle.Normalize();
1516 aRectangle = lclMirrorRectangle(aRectangle, rRef1, rRef2);
1555 mpImpl->mnRelativeWidth.reset();
1556 mpImpl->meRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
1557 mpImpl->meRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
1558 mpImpl->mnRelativeHeight.reset();
1570 NbcCrop(rRef, fxFact, fyFact);
1610 Size aSiz(rPnt.
X()-aRelPos0.
X(),rPnt.
Y()-aRelPos0.
Y());
1773 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrObject"));
1774 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
1775 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s", BAD_CAST(
typeid(*this).name()));
1776 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"name"),
"%s", BAD_CAST(
GetName().toUtf8().getStr()));
1777 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"title"),
"%s", BAD_CAST(
GetTitle().toUtf8().getStr()));
1778 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"description"),
"%s", BAD_CAST(
GetDescription().toUtf8().getStr()));
1779 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"nOrdNum"),
"%" SAL_PRIuUINT32,
GetOrdNumDirect());
1780 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"aOutRect"), BAD_CAST(
getOutRectangle().
toString().getStr()));
1793 pOutliner->dumpAsXml(pWriter);
1795 (void)xmlTextWriterEndElement(pWriter);
1864 return PointerStyle::RefHand;
1876 for(
auto const& rPolygon : aPolyPolygon)
1897 return std::make_unique<SdrObjGeoData>();
1913 if (rGeo.
pGPL!=
nullptr) {
1936 if (rGeo.
pGPL!=
nullptr) {
1952 std::unique_ptr<SdrObjGeoData> pGeo =
NewGeoData();
2036 aRef1.
setX(pPoolItem->GetValue() );
2040 aRef1.
setY(pPoolItem->GetValue() );
2074 if (aNewSnap!=rSnap) {
2119 bool b = pPoolItem->GetValue();
2124 bool b = pPoolItem->GetValue();
2134 bool b = pPoolItem->GetValue();
2140 bool b = pPoolItem->GetValue();
2147 nLayer = pPoolItem->GetValue();
2151 OUString aLayerName = pPoolItem->GetValue();
2157 if(
nullptr != pLayer)
2159 nLayer=pLayer->
GetID();
2168 OUString
aName = pPoolItem->GetValue();
2182 if (aNewLogic!=rLogic) {
2189 aResizeX *= pPoolItem->GetValue();
2193 aResizeY *= pPoolItem->GetValue();
2222 if (!
aName.isEmpty())
2232 if(
nullptr != pLayer)
2301 case 0 : aPt=aR.
TopLeft();
break;
2344 pGPL->
Rotate(rRef,nAngle,sn,cs,
this);
2354 pGPL->
Mirror(rRef1,rRef2,
this);
2364 pGPL->
Shear(rRef,tn,bVShear,
this);
2387 rExtractedHairlines.clear();
2388 rExtractedLineFills.clear();
2390 if(rxSequence.empty())
2398 aExtractor.
process(rxSequence);
2419 if(!xSequence.empty())
2429 aMergedHairlinePolyPolygon.
append(rExtractedHairline);
2440 if(aMergedLineFillPolyPolygon.
count() || (bForceLineDash && aMergedHairlinePolyPolygon.
count()))
2446 bool bBuildGroup(
false);
2448 if(aMergedLineFillPolyPolygon.
count())
2454 std::move(aMergedLineFillPolyPolygon));
2465 aLinePolygonPart->SetMergedItemSet(aSet);
2468 if(aMergedHairlinePolyPolygon.
count())
2477 std::move(aMergedHairlinePolyPolygon));
2487 aLineHairlinePart->SetMergedItemSet(aSet);
2489 if(aLinePolygonPart)
2496 bool bAddOriginalGeometry(
false);
2501 if(eOldFillStyle != drawing::FillStyle_NONE)
2503 bAddOriginalGeometry =
true;
2508 if(bBuildGroup || bAddOriginalGeometry)
2512 if(bAddOriginalGeometry)
2521 pClone->SetMergedItemSet(aSet);
2523 pGroup->GetSubList()->NbcInsertObject(pClone.get());
2526 if(aLinePolygonPart)
2528 pGroup->GetSubList()->NbcInsertObject(aLinePolygonPart.get());
2531 if(aLineHairlinePart)
2533 pGroup->GetSubList()->NbcInsertObject(aLineHairlinePart.get());
2540 if(aLinePolygonPart)
2542 pRetval = aLinePolygonPart;
2544 else if(aLineHairlinePart)
2546 pRetval = aLineHairlinePart;
2584 if(
dynamic_cast<const SdrObjGroup*
>( pRet.get()) !=
nullptr)
2607 pRet = pRet->ImpConvertToContourObj(bForceLineDash);
2611 if(pRet && pRet->GetLayer() !=
GetLayer())
2624 if(pRet && bLineToArea)
2630 if(pRet && pRet->GetLayer() !=
GetLayer())
2720 return m_pPlusData->pUserDataList->GetUserDataCount();
2726 return &
m_pPlusData->pUserDataList->GetUserData(nNum);
2733 OSL_FAIL(
"SdrObject::AppendUserData(): pData is NULL pointer.");
2753 OSL_FAIL(
"SdrObject::DeleteUserData(): Invalid Index.");
2810 switch ( eUserCall )
2826 const uno::Reference< uno::XInterface>& xOldUnoShape(
maWeakUnoShape );
2828 if ( _rxUnoShape == xOldUnoShape )
2830 if ( !xOldUnoShape.is() )
2840 if ( xOldUnoShape.is() )
2848 mpSvxShape = comphelper::getFromUnoTunnel<SvxShape>( _rxUnoShape );
2913 if(
nullptr == pPageCandidate)
2927 if(
nullptr != pPageCandidate)
2929 uno::Reference< uno::XInterface > xPage(pPageCandidate->
getUnoPage());
2932 SvxDrawPage* pDrawPage = comphelper::getFromUnoTunnel<SvxDrawPage>(xPage);
3013 double fRotate, fShearX;
3014 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
3100 SdrObjList* pObjList = pE3dObj->GetSubList();
3113 std::unordered_set<OUString> aNameSet;
3122 if (rNameSet.empty())
3132 pObj = aIter.
Next();
3134 rNameSet.insert(pObj->
GetName());
3140 OUString sRootName(
sName);
3142 if (!
sName.isEmpty() && rtl::isAsciiDigit(
sName[
sName.getLength() - 1]))
3149 for (sal_uInt32
n = 1; rNameSet.find(
sName) != rNameSet.end();
n++)
3150 sName = sRootName +
" " + OUString::number(
n);
3151 rNameSet.insert(
sName);
3158 MapUnit eMapUnit(getSdrModelFromSdrObject().GetItemPool().GetMetric(0));
3159 if(eMapUnit == MapUnit::Map100thMM)
3169 OSL_FAIL(
"Missing unit translation to PoolMetric!");
3201 return static_cast<E3dScene*
>(pObj);
3238template <SdrObjKind OBJECT_KIND, SdrInventor OBJECT_INVENTOR>
3239class EmptyObject final :
public SdrObject
3242 virtual ~EmptyObject()
override
3251 EmptyObject(
SdrModel& rSdrModel, EmptyObject
const& rSource)
3258 return new EmptyObject(rTargetModel, *
this);
3263 return OBJECT_INVENTOR;
3271 void NbcRotate(
const Point& ,
Degree100 ,
double ,
double )
override
3286 bool bSetSnapRect(
nullptr != pSnapRect);
3290 switch (nIdentifier)
3294 if(
nullptr != pSnapRect)
3309 if(
nullptr != pSnapRect)
3338 if(
nullptr != pSnapRect)
3344 bSetSnapRect =
false;
3360 if(
nullptr != pSnapRect)
3362 pObj =
new SdrCircObj(rSdrModel, eCircKind, *pSnapRect);
3363 bSetSnapRect =
false;
3390#if HAVE_FEATURE_AVMEDIA
3395 pObj =
new EmptyObject<SdrObjKind::NewFrame, SdrInventor::Default>(rSdrModel);
3413 if(bSetSnapRect &&
nullptr != pSnapRect)
3415 pObj->NbcSetSnapRect(*pSnapRect);
3424 auto it = std::find(rLL.begin(), rLL.end(), rLink);
3425 if (it != rLL.end()) {
3426 OSL_FAIL(
"SdrObjFactory::InsertMakeObjectHdl(): Link already in place.");
3428 rLL.push_back(rLink);
3435 auto it = std::find(rLL.begin(), rLL.end(), rLink);
3436 if (it != rLL.end())
constexpr o3tl::Length MapToO3tlLength(MapUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
static rtl::Reference< SfxItemPool > CreatePool()
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
void DrawPolyLine(const tools::Polygon &rPoly)
RasterOp GetRasterOp() const
void SetRasterOp(RasterOp eRasterOp)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void SetActionRect(const tools::Rectangle &rR)
sal_Int32 GetPointCount() const
void TakeCreateRect(tools::Rectangle &rRect) const
void SetOrtho4Possible(bool bOn=true)
const Point & GetStart() const
SdrView * GetView() const
const SdrHdl * GetHdl() const
const Point & GetNow() const
Utility class SdrEdgeObj.
SdrObject * GetConnectedNode(bool bTail1) const override
void SetReallyAbsolute(bool bOn, const SdrObject &rObj)
void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs, const SdrObject *pObj)
void Mirror(const Point &rRef1, const Point &rRef2, const SdrObject *pObj)
void Shear(const Point &rRef, double tn, bool bVShear, const SdrObject *pObj)
void SetPercent(bool bOn)
This class represents an embedded or linked bitmap graphic object.
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdlKind GetKind() const
SdrLayer * GetLayerPerID(SdrLayerID nID)
SdrLayer * GetLayer(sal_uInt16 i)
const OUString & GetName() const
virtual void SetChanged(bool bFlg=true)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
const SfxItemPool & GetItemPool() const
bool IsInDestruction() const
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
std::unordered_set< SdrObject * > maAllIncarnatedObjects
sal_uInt16 GetPageCount() const
static SVX_DLLPRIVATE rtl::Reference< SdrObject > CreateObjectFromFactory(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nIdentifier)
static void InsertMakeObjectHdl(Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > const &rLink)
static void RemoveMakeObjectHdl(Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > const &rLink)
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
All geometrical data of an arbitrary object for use in undo/redo.
std::unique_ptr< SdrGluePointList > pGPL
tools::Rectangle aBoundRect
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
void SetSdrObjListRectsDirty()
virtual SdrObject * getSdrObjectFromSdrObjList() const
const SdrPageView * pPageView
const SdrLayerIDSet * pVisiLayer
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
virtual void const * GetPDFAnchorStructureElementKey(SdrObject const &rObj)
virtual ~SdrObjUserCall()
User data of a drawing object, e.g.
virtual ~SdrObjUserData()
SdrObjUserData(SdrInventor nInv, sal_uInt16 nId)
void SetBLIPSizeRectangle(const tools::Rectangle &aRect)
sal_uInt32 GetOrdNumDirect() const
virtual bool BckCreate(SdrDragStat &rStat)
virtual void RecalcSnapRect()
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
virtual ~SdrObject() override
void setOutRectangleConst(tools::Rectangle const &rRectangle) const
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties()
virtual void NbcSetAnchorPos(const Point &rPnt)
bool IsResizeProtect() const
void SetDoNotInsertIntoPageAutomatically(bool bSet)
virtual Degree100 GetShearAngle(bool bVertical=false) const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void InsertedStateChange()
std::unique_ptr< Impl > mpImpl
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const
virtual void NbcCrop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
virtual bool DoMacro(const SdrObjMacroHitRec &rRec)
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
virtual void SetAnchorPos(const Point &rPnt)
SdrObjUserCall * GetUserCall() const
virtual Degree100 GetRotateAngle() const
SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList *pNew)
virtual void SetGrabBagItem(const css::uno::Any &rVal)
const Point & GetAnchorPos() const
void ActionChanged() const
void SetRelativeHeight(double nValue)
bool mbLineIsOutsideGeometry
virtual void SAL_CALL acquire() noexcept override final
virtual SdrGluePointList * ForceGluePointList()
virtual bool HasText() const
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i)
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
SdrModel & mrSdrModelFromSdrObject
SvxShape * getSvxShape()
only for internal use!
virtual void NbcSetLayer(SdrLayerID nLayer)
void ImpSetAnchorPos(const Point &rPnt)
const tools::Rectangle & getOutRectangle() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
void SetMarkProtect(bool bProt)
virtual rtl::Reference< SdrObject > getFullDragClone() const
void moveOutRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
virtual sdr::properties::BaseProperties & GetProperties() const
tools::Rectangle maBLIPSizeRectangle
virtual void Crop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
void notifyShapePropertyChange(const svx::ShapePropertyProviderId _eProperty) const
virtual bool IsTextBox() const
Is this a textbox of a drawinglayer shape?
void SetRelativeHeightRelation(sal_Int16 eValue)
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
const SfxBroadcaster * GetBroadcaster() const
virtual OUString TakeObjNamePlural() const
virtual void InternalSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast)
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
virtual Point GetPoint(sal_uInt32 i) const
virtual bool BegCreate(SdrDragStat &rStat)
Every object must be able to create itself interactively.
const double * GetRelativeHeight() const
std::unique_ptr< SdrObjPlusData > m_pPlusData
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &_rxUnoShape)
Sets a new UNO representation of the shape.
static SdrItemPool & GetGlobalDrawObjectItemPool()
SdrObject(SdrModel &rSdrModel)
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
virtual OUString GetTitle() const
bool LineGeometryUsageIsNecessary() const
void BroadcastObjectChange() const
virtual void SetTitle(const OUString &rStr)
virtual void SAL_CALL release() noexcept override final
SfxItemPool & GetObjectItemPool() const
void SetObjectItemSet(const SfxItemSet &rSet)
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
bool IsMoveProtect() const
virtual std::unique_ptr< SdrObjGeoData > GetGeoData() const
virtual void NbcSetRelativePos(const Point &rPnt)
The relative position of a SdrObject is the distance of the upper left corner of the logic bounding r...
void SetUserCall(SdrObjUserCall *pUser)
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const
void SetEmptyPresObj(bool bEpt)
void NbcApplyNotPersistAttr(const SfxItemSet &rAttr)
bool mbSupportTextIndentingOnLineWidthChange
sal_uInt16 GetUserDataCount() const
virtual void SetDescription(const OUString &rStr)
void SingleObjectPainter(OutputDevice &rOut) const
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
rtl::Reference< SdrObject > ImpConvertToContourObj(bool bForceLineDash)
virtual SdrInventor GetObjInventor() const
void RemoveListener(SfxListener &rListener)
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const
Polygon dragged by the user when creating the object.
virtual OutlinerParaObject * GetOutlinerParaObject() const
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
void SetObjectItem(const SfxPoolItem &rItem)
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
void SetVisible(bool bVisible)
SdrObjList * mpParentOfSdrObject
void SetRelativeWidth(double nValue)
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
virtual bool supportsFullDrag() const
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
virtual void Mirror(const Point &rRef1, const Point &rRef2)
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
virtual SdrObjList * GetSubList() const
virtual bool IsPolyObj() const
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
void SetNavigationPosition(const sal_uInt32 nPosition)
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
virtual bool MovCreate(SdrDragStat &rStat)
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual void Move(const Size &rSiz)
virtual bool HasLimitedRotation() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
void SetResizeProtect(bool bProt)
void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon &rPolyPolygon) const noexcept
virtual OUString GetDescription() const
const double * GetRelativeWidth() const
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
SdrObjList * getParentSdrObjListFromSdrObject() const
SdrModel & getSdrModelFromSdrObject() const
virtual const tools::Rectangle & GetSnapRect() const
SdrObjUserCall * m_pUserCall
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
void NbcShearGluePoints(const Point &rRef, double tn, bool bVShear)
virtual void SetLogicRect(const tools::Rectangle &rRect)
virtual void SetGeoData(const SdrObjGeoData &rGeo)
SfxStyleSheet * GetStyleSheet() const
virtual const OUString & GetName() const
virtual SdrObjList * getChildrenOfSdrObject() const
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
void SetMoveProtect(bool bProt)
bool Equals(const SdrObject &) const
bool isVisibleOnAnyOfTheseLayers(const SdrLayerIDSet &rSet) const
std::unique_ptr< SfxGrabBagItem > m_pGrabBagItem
void SetNotVisibleAsMaster(bool bFlg)
virtual bool IsSdrTextObj() const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
void SetRelativeWidthRelation(sal_Int16 eValue)
virtual bool HasTextEdit() const
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
bool IsGroupObject() const
sdr::contact::ViewContact & GetViewContact() const
virtual PointerStyle GetCreatePointer() const
get the cursor/pointer that signals creating this object
void SetOrdNum(sal_uInt32 nNum)
void BurnInStyleSheetAttributes()
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
virtual void PaintMacro(OutputDevice &rOut, const tools::Rectangle &rDirtyRect, const SdrObjMacroHitRec &rRec) const
bool HasLineStyle() const
void SetPoint(const Point &rPnt, sal_uInt32 i)
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
sal_Int16 GetRelativeHeightRelation() const
virtual void ConnectToNode(bool bTail1, SdrObject *pObj)
virtual void SetChanged()
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
void AddObjectUser(sdr::ObjectUser &rNewUser)
tools::Rectangle m_aOutRect
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLastBoundRect() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
virtual sal_uInt32 GetHdlCount() const
Via GetHdlCount the number of Handles can be retrieved.
void AddListener(SfxListener &rListener)
sal_uInt32 GetNavigationPosition() const
SdrPage * getSdrPageFromSdrObject() const
virtual const SdrGluePointList * GetGluePointList() const
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
virtual void SetSnapRect(const tools::Rectangle &rRect)
std::unique_ptr< sdr::contact::ViewContact > mpViewContact
rtl::Reference< SdrObject > ConvertToContourObj(SdrObject *pRet, bool bForceLineDash=false) const
virtual void DisconnectFromNode(bool bTail1)
const SfxItemSet & GetMergedItemSet() const
virtual void NbcReformatText()
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual SdrObject * CheckMacroHit(const SdrObjMacroHitRec &rRec) const
virtual OUString TakeObjNameSingul() const
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
void ClearMergedItem(const sal_uInt16 nWhich=0)
bool IsInDestruction() const
virtual SdrLayerID GetLayer() const
void SetMergedItem(const SfxPoolItem &rItem)
void RemoveObjectUser(sdr::ObjectUser &rOldUser)
bool HasFillStyle() const
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
void AddReference(SdrVirtObj &rVrtObj)
virtual SdrObject * GetConnectedNode(bool bTail1) const
virtual void AddToHdlList(SdrHdlList &rHdlList) const
virtual bool applySpecialDrag(SdrDragStat &rDrag)
void DelReference(SdrVirtObj &rVrtObj)
OUString GetMetrStr(tools::Long nVal) const
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
virtual void RecalcBoundRect()
virtual void SetLayer(SdrLayerID nLayer)
virtual void BrkCreate(SdrDragStat &rStat)
virtual void SetDecorative(bool isDecorative)
void DeleteUserData(sal_uInt16 nNum)
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const
sal_Int16 GetRelativeWidthRelation() const
bool mbDoNotInsertIntoPageAutomatically
void registerProvider(const svx::ShapePropertyProviderId _eProperty, std::unique_ptr< svx::PropertyValueProvider > propProvider)
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
virtual void addCropHandles(SdrHdlList &rTarget) const
void GetGrabBagItem(css::uno::Any &rVal) const
void setOutRectangle(tools::Rectangle const &rRectangle)
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
virtual Point GetSnapPoint(sal_uInt32 i) const
void TakeNotPersistAttr(SfxItemSet &rAttr) const
css::uno::WeakReference< css::drawing::XShape > maWeakUnoShape
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual bool HasMacro() const
sal_uInt32 mnNavigationPosition
virtual bool IsDecorative() const
void ApplyNotPersistAttr(const SfxItemSet &rAttr)
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const
virtual void SetRelativePos(const Point &rPnt)
std::unique_ptr< sdr::properties::BaseProperties > mpProperties
void SetGlueReallyAbsolute(bool bOn)
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
virtual void SetBoundRectDirty()
bool m_bNotVisibleAsMaster
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
virtual Point GetRelativePos() const
const SfxItemSet & GetObjectItemSet() const
virtual sal_uInt32 GetPointCount() const
void SetPrintable(bool bPrn)
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
virtual const tools::Rectangle & GetLogicRect() const
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs)=0
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
virtual SdrPage * getSdrPageFromSdrObjList() const override
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
Rectangle objects (rectangle, circle, ...)
static std::unique_ptr< SdrUndoAction > CreateUndoObjectStrAttr(SdrObject &rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, const OUString &sOldStr, const OUString &sNewStr)
static std::unique_ptr< SdrUndoAction > CreateUndoObjectDecorative(SdrObject &rObject, bool const WasDecorative)
FIXME: The virtual object is not yet fully implemented and tested.
void Broadcast(const SfxHint &rHint)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
virtual css::uno::Reference< css::drawing::XShape > CreateShape(SdrObject *pObj) const
static rtl::Reference< SvxShape > CreateShapeByTypeAndInventor(SdrObjKind nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage=nullptr, OUString const &referer=OUString())
void InvalidateSdrObject()
void notifyPropertyChange(svx::ShapePropertyProviderId eProp)
void registerProvider(svx::ShapePropertyProviderId eProp, std::unique_ptr< svx::PropertyValueProvider > provider)
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
oslInterlockedCount m_refCount
void disposeWeakConnectionPoint()
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &aViewInformation) const
void process(const primitive2d::Primitive2DContainer &rSource)
virtual void SetObjectItemSet(const SfxItemSet &rSet)=0
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast)=0
virtual void ClearMergedItem(const sal_uInt16 nWhich)
virtual void ForceStyleToHardAttributes()
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const =0
virtual const SfxItemSet & GetMergedItemSet() const
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
virtual void SetMergedItem(const SfxPoolItem &rItem)
virtual void SetObjectItem(const SfxPoolItem &rItem)=0
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
virtual const SfxItemSet & GetObjectItemSet() const =0
virtual SfxStyleSheet * GetStyleSheet() const =0
virtual ~ISdrObjectFilter()=0
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
#define DBG_TESTSOLARMUTEX()
OUString SvxResId(TranslateId aId)
struct _xmlTextWriter * xmlTextWriterPtr
tools::Long FRound(double fVal)
std::unique_ptr< sal_Int32[]> pData
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
B2DPolyPolygon mergeToSinglePolyPolygon(const B2DPolyPolygonVector &rInput)
B2DPolygon simplifyCurveSegments(const B2DPolygon &rCandidate)
::std::vector< B2DPolygon > B2DPolygonVector
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
Reference< XComponentContext > getProcessComponentContext()
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
void reset_preserve_ptr_during(uniqueptr &ptr)
constexpr OUStringLiteral EMPTY
::std::vector< ObjectUser * > ObjectUserVector
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString toString(OptionInfo const *info)
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, const basegfx::B2DVector &rHitTolerance, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
sdr::ObjectUserVector maObjectUsers
std::optional< double > mnRelativeHeight
sal_Int16 meRelativeHeightRelation
sal_Int16 meRelativeWidthRelation
std::optional< double > mnRelativeWidth
constexpr TypedWhichId< SdrShearAngleItem > SDRATTR_SHEARANGLE(SDRATTR_NOTPERSIST_FIRST+17)
constexpr TypedWhichId< SdrLayerNameItem > SDRATTR_LAYERNAME(SDRATTR_NOTPERSIST_FIRST+4)
constexpr TypedWhichId< SdrLayerIdItem > SDRATTR_LAYERID(SDRATTR_NOTPERSIST_FIRST+3)
constexpr TypedWhichId< SdrVertShearOneItem > SDRATTR_VERTSHEARONE(SDRATTR_NOTPERSIST_FIRST+24)
constexpr TypedWhichId< SdrObjPrintableItem > SDRATTR_OBJPRINTABLE(SDRATTR_NOTPERSIST_FIRST+2)
constexpr TypedWhichId< SdrLogicSizeHeightItem > SDRATTR_LOGICSIZEHEIGHT(SDRATTR_NOTPERSIST_FIRST+15)
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJSIZEPROTECT(SDRATTR_NOTPERSIST_FIRST+1)
constexpr TypedWhichId< SdrObjVisibleItem > SDRATTR_OBJVISIBLE(SDRATTR_NOTPERSIST_FIRST+35)
constexpr TypedWhichId< SdrOneSizeHeightItem > SDRATTR_ONESIZEHEIGHT(SDRATTR_NOTPERSIST_FIRST+13)
constexpr TypedWhichId< SdrOneSizeWidthItem > SDRATTR_ONESIZEWIDTH(SDRATTR_NOTPERSIST_FIRST+12)
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_OBJMOVEPROTECT(SDRATTR_NOTPERSIST_FIRST+0)
constexpr TypedWhichId< SdrMoveXItem > SDRATTR_MOVEX(SDRATTR_NOTPERSIST_FIRST+18)
constexpr TypedWhichId< SdrOnePositionYItem > SDRATTR_ONEPOSITIONY(SDRATTR_NOTPERSIST_FIRST+11)
constexpr TypedWhichId< SfxStringItem > SDRATTR_OBJECTNAME(SDRATTR_NOTPERSIST_FIRST+5)
constexpr TypedWhichId< SdrMoveYItem > SDRATTR_MOVEY(SDRATTR_NOTPERSIST_FIRST+19)
constexpr TypedWhichId< SdrTransformRef1YItem > SDRATTR_TRANSFORMREF1Y(SDRATTR_NOTPERSIST_FIRST+31)
constexpr TypedWhichId< SdrHorzShearOneItem > SDRATTR_HORZSHEARONE(SDRATTR_NOTPERSIST_FIRST+23)
constexpr TypedWhichId< SdrRotateOneItem > SDRATTR_ROTATEONE(SDRATTR_NOTPERSIST_FIRST+22)
constexpr TypedWhichId< SdrLogicSizeWidthItem > SDRATTR_LOGICSIZEWIDTH(SDRATTR_NOTPERSIST_FIRST+14)
constexpr TypedWhichId< SdrOnePositionXItem > SDRATTR_ONEPOSITIONX(SDRATTR_NOTPERSIST_FIRST+10)
constexpr TypedWhichId< SdrResizeXOneItem > SDRATTR_RESIZEXONE(SDRATTR_NOTPERSIST_FIRST+20)
constexpr TypedWhichId< SdrResizeYOneItem > SDRATTR_RESIZEYONE(SDRATTR_NOTPERSIST_FIRST+21)
constexpr TypedWhichId< SdrTransformRef1XItem > SDRATTR_TRANSFORMREF1X(SDRATTR_NOTPERSIST_FIRST+30)
constexpr TypedWhichId< SdrAngleItem > SDRATTR_ROTATEANGLE(SDRATTR_NOTPERSIST_FIRST+16)
std::vector< Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > > & ImpGetUserMakeObjHdl()
void impAddIncarnatedSdrObjectToSdrModel(SdrObject &rSdrObject, SdrModel &rSdrModel)
E3dObject * DynCastE3dObject(SdrObject *pObj)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
static rtl::Reference< SdrItemPool > mpGlobalItemPool
static void extractLineContourFromPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DContainer &rxSequence, basegfx::B2DPolygonVector &rExtractedHairlines, basegfx::B2DPolyPolygonVector &rExtractedLineFills)
E3dScene * DynCastE3dScene(SdrObject *pObj)
void impRemoveIncarnatedSdrObjectToSdrModel(SdrObject &rSdrObject, SdrModel &rSdrModel)
@ Group
abstract object (SdrObject)
@ Measure
object that represents a SdrPage
@ Page
Polyline represented by SdrPathObj.
@ Caption
connector object
@ PathFill
open Bezier-curve
@ FreehandLine
closed Bezier-curve
@ UNO
continuously activated OLE (PlugIn-Frame or similar)
@ CustomShape
Universal Network Object packed into SvDraw object.
@ CircleOrEllipse
rectangle (round corners optional)
@ Text
closed free-hand line
@ OLE2
foreign graphic (StarView Graphic)
@ OLEPluginFrame
measurement object
@ Graphic
OutlineText, special text object for StarDraw.
@ PathPolyLine
Polygon/PolyPolygon represented by SdrPathObj.
@ CircleSection
circle, ellipse
@ OutlineText
TitleText, special text object for StarDraw.
@ CircleArc
circle section
@ PolyLine
polygon, PolyPolygon
@ FreehandFill
open free-hand line
SdrCircKind ToSdrCircKind(SdrObjKind eKind)
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
constexpr SdrLayerID SDRLAYER_NOTFOUND(-1)
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XLineTransparenceItem > XATTR_LINETRANSPARENCE(XATTR_LINE_FIRST+10)