summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc
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 /sc/source/ui/inc
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 'sc/source/ui/inc')
-rw-r--r--sc/source/ui/inc/fuconarc.hxx2
-rw-r--r--sc/source/ui/inc/fuconcustomshape.hxx2
-rw-r--r--sc/source/ui/inc/fuconpol.hxx2
-rw-r--r--sc/source/ui/inc/fuconrec.hxx2
-rw-r--r--sc/source/ui/inc/fuconuno.hxx2
-rw-r--r--sc/source/ui/inc/fupoor.hxx2
-rw-r--r--sc/source/ui/inc/futext.hxx2
-rw-r--r--sc/source/ui/inc/notemark.hxx2
8 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/ui/inc/fuconarc.hxx b/sc/source/ui/inc/fuconarc.hxx
index d1fb31aada2e..a330840ed078 100644
--- a/sc/source/ui/inc/fuconarc.hxx
+++ b/sc/source/ui/inc/fuconarc.hxx
@@ -37,7 +37,7 @@ public:
virtual void Deactivate() override;
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
+ virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconcustomshape.hxx b/sc/source/ui/inc/fuconcustomshape.hxx
index 89f22d17a5bb..b491b48fe5e6 100644
--- a/sc/source/ui/inc/fuconcustomshape.hxx
+++ b/sc/source/ui/inc/fuconcustomshape.hxx
@@ -40,7 +40,7 @@ public:
virtual void Deactivate() override;
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject( const sal_uInt16 nID, const tools::Rectangle& rRectangle ) override;
+ virtual rtl::Reference<SdrObject> CreateDefaultObject( const sal_uInt16 nID, const tools::Rectangle& rRectangle ) override;
// #i33136#
virtual bool doConstructOrthogonal() const override;
diff --git a/sc/source/ui/inc/fuconpol.hxx b/sc/source/ui/inc/fuconpol.hxx
index e09225136649..8cebc3b03a76 100644
--- a/sc/source/ui/inc/fuconpol.hxx
+++ b/sc/source/ui/inc/fuconpol.hxx
@@ -38,7 +38,7 @@ public:
virtual void Deactivate() override;
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
+ virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconrec.hxx b/sc/source/ui/inc/fuconrec.hxx
index 1f3fbb8ee770..865ad5b2b425 100644
--- a/sc/source/ui/inc/fuconrec.hxx
+++ b/sc/source/ui/inc/fuconrec.hxx
@@ -38,7 +38,7 @@ public:
static void SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal_uInt16 nSlotId);
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
+ virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fuconuno.hxx b/sc/source/ui/inc/fuconuno.hxx
index 1c58d5db3f12..a1034c3ed4b6 100644
--- a/sc/source/ui/inc/fuconuno.hxx
+++ b/sc/source/ui/inc/fuconuno.hxx
@@ -44,7 +44,7 @@ public:
SC_DLLPUBLIC virtual void Deactivate() override;
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
+ virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx
index 978a2ca095ed..6f226776b03f 100644
--- a/sc/source/ui/inc/fupoor.hxx
+++ b/sc/source/ui/inc/fupoor.hxx
@@ -94,7 +94,7 @@ public:
void StopDragTimer();
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle);
+ virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle);
protected:
static void ImpForceQuadratic(tools::Rectangle& rRect);
diff --git a/sc/source/ui/inc/futext.hxx b/sc/source/ui/inc/futext.hxx
index c53a5b38892d..fc8e75dc15c0 100644
--- a/sc/source/ui/inc/futext.hxx
+++ b/sc/source/ui/inc/futext.hxx
@@ -47,7 +47,7 @@ public:
void StopEditMode();
// Create default drawing objects via keyboard
- virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
+ virtual rtl::Reference<SdrObject> CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
private:
std::unique_ptr<SdrOutliner> MakeOutliner();
diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx
index 5fb1d6e94704..31965be07802 100644
--- a/sc/source/ui/inc/notemark.hxx
+++ b/sc/source/ui/inc/notemark.hxx
@@ -49,7 +49,7 @@ private:
tools::Rectangle m_aRect;
std::unique_ptr<SdrModel> m_pModel;
- ScCaptionPtr m_xObject;
+ rtl::Reference<SdrCaptionObj> m_xObject;
bool m_bVisible;
DECL_LINK( TimeHdl, Timer*, void );