summaryrefslogtreecommitdiff
path: root/include/svx/svdoashp.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-27 10:27:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-29 13:44:02 +0200
commit8611f6e259b807b4f19c8dc0eab86ca648891ce3 (patch)
treefa2b0e463aafb51df754768f916ca9104969a557 /include/svx/svdoashp.hxx
parent25a997c15d39fb30676a375df8ea4ce1ed2e1acd (diff)
ref-count SdrObject
Which means we can get rid of the majestic hack of ScCaptionPtr Previously, SdrObject was manually managed, and the ownership passed around in very complicated fashion. Notes: (*) SvxShape has a strong reference to SdrObject, where previously it had a weak reference. It is now strong since otherwise the SdrObject will go away very eagerly. (*) SdrObject still has a weak reference to SvxShape (*) In the existing places that an SdrObject is being deleted, we now just clear the reference (*) instead of SwVirtFlyDrawObj removing itself from the page that contains inside it's destructor, make the call site do the removing from the page. (*) Needed to take the SolarMutex in UndoManagerHelper_Impl::impl_clear because this can be called from UNO (e.g. sfx2_complex JUnit test) and the SdrObjects need the SolarMutex when destructing. (*) handle a tricky situation with SwDrawVirtObj in the SwDrawModel destructor because the existing code wants mpDrawObj in SwAnchoredObject to be sometimes owning, sometimes not, which results in a cycle with the new code. Change-Id: I4d79df1660e386388e5d51030653755bca02a163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx/svdoashp.hxx')
-rw-r--r--include/svx/svdoashp.hxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index e161db2a71ac..1a7521a2c764 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -93,7 +93,7 @@ public:
mutable css::uno::Reference< css::drawing::XCustomShapeEngine > mxCustomShapeEngine;
// #i37011# render geometry shadow
- SdrObject* mpLastShadowGeometry;
+ rtl::Reference<SdrObject> mpLastShadowGeometry;
css::uno::Reference< css::drawing::XCustomShapeEngine > const & GetCustomShapeEngine() const;
@@ -128,9 +128,6 @@ protected:
Size m_aSuggestedTextFrameSize;
- // protected destructor
- virtual ~SdrObjCustomShape() override;
-
virtual void InternalSetStyleSheet( SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast ) override;
public:
@@ -146,6 +143,7 @@ public:
SdrObjCustomShape(SdrModel& rSdrModel);
SdrObjCustomShape(SdrModel& rSdrModel, SdrObjCustomShape const & rSource);
+ virtual ~SdrObjCustomShape() override;
/* is merging default attributes from type-shape into the SdrCustomShapeGeometryItem. If pType
is NULL then the type is being taken from the "Type" property of the SdrCustomShapeGeometryItem.
@@ -210,7 +208,7 @@ public:
virtual void TakeTextAnchorRect( tools::Rectangle& rAnchorRect ) const override;
virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText,
tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const override;
- virtual SdrObjCustomShape* CloneSdrObject(SdrModel& rTargetModel) const override;
+ virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
virtual OUString TakeObjNameSingul() const override;
virtual OUString TakeObjNamePlural() const override;
@@ -222,7 +220,7 @@ public:
virtual void NbcSetOutlinerParaObject(std::optional<OutlinerParaObject> pTextObject) override;
- virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
+ virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
// react on model/page change
virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override;