From 8611f6e259b807b4f19c8dc0eab86ca648891ce3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 27 May 2021 10:27:46 +0200 Subject: 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 --- svx/source/engine3d/polygn3d.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'svx/source/engine3d/polygn3d.cxx') diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index e7a5623bf01d..3303cfe77d60 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -217,12 +217,13 @@ void E3dPolygonObj::SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyText // Convert the object into a group object consisting of 6 polygons -SdrObjectUniquePtr E3dPolygonObj::DoConvertToPolyObj(bool /*bBezier*/, bool /*bAddText*/) const +rtl::Reference E3dPolygonObj::DoConvertToPolyObj(bool /*bBezier*/, + bool /*bAddText*/) const { return nullptr; } -E3dPolygonObj* E3dPolygonObj::CloneSdrObject(SdrModel& rTargetModel) const +rtl::Reference E3dPolygonObj::CloneSdrObject(SdrModel& rTargetModel) const { return new E3dPolygonObj(rTargetModel, *this); } -- cgit