ref-count SdrObject
commit8611f6e259b807b4f19c8dc0eab86ca648891ce3
authorNoel Grandin <noel.grandin@collabora.co.uk>
Thu, 27 May 2021 08:27:46 +0000 (27 10:27 +0200)
committerNoel Grandin <noel.grandin@collabora.co.uk>
Mon, 29 Aug 2022 11:44:02 +0000 (29 13:44 +0200)
treefa2b0e463aafb51df754768f916ca9104969a557
parent25a997c15d39fb30676a375df8ea4ce1ed2e1acd
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>
314 files changed:
basctl/source/dlged/dlged.cxx
basctl/source/dlged/dlgedfac.cxx
basctl/source/dlged/dlgedobj.cxx
basctl/source/inc/dlged.hxx
basctl/source/inc/dlgedfac.hxx
basctl/source/inc/dlgedobj.hxx
chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
chart2/source/controller/main/ChartController_Tools.cxx
chart2/source/controller/main/DrawCommandDispatch.cxx
chart2/source/controller/main/DrawCommandDispatch.hxx
chart2/source/view/main/ChartView.cxx
chart2/source/view/main/ShapeFactory.cxx
compilerplugins/clang/refcounting.cxx
compilerplugins/clang/test/refcounting.cxx
compilerplugins/clang/weakobject.cxx
cui/source/tabpages/tpline.cxx
cui/source/tabpages/tplneend.cxx
filter/source/msfilter/escherex.cxx
filter/source/msfilter/msdffimp.cxx
filter/source/msfilter/svdfppt.cxx
filter/source/svg/svgexport.cxx
filter/source/svg/svgfilter.cxx
framework/source/fwe/helper/undomanagerhelper.cxx
include/filter/msfilter/msdffimp.hxx
include/filter/msfilter/svdfppt.hxx
include/svx/EnhancedCustomShape2d.hxx
include/svx/compressgraphicdialog.hxx
include/svx/connctrl.hxx
include/svx/cube3d.hxx
include/svx/dlgctl3d.hxx
include/svx/dlgctrl.hxx
include/svx/extedit.hxx
include/svx/fmdpage.hxx
include/svx/fmobjfac.hxx
include/svx/fmpage.hxx
include/svx/fmview.hxx
include/svx/fontworkgallery.hxx
include/svx/lathe3d.hxx
include/svx/measctrl.hxx
include/svx/obj3d.hxx
include/svx/objfac3d.hxx
include/svx/scene3d.hxx
include/svx/sdr/table/tablecontroller.hxx
include/svx/selectioncontroller.hxx
include/svx/sphere3d.hxx
include/svx/svdcrtv.hxx
include/svx/svddrgmt.hxx
include/svx/svdedtv.hxx
include/svx/svdedxv.hxx
include/svx/svdetc.hxx
include/svx/svdmodel.hxx
include/svx/svdoashp.hxx
include/svx/svdobj.hxx
include/svx/svdocapt.hxx
include/svx/svdocirc.hxx
include/svx/svdoedge.hxx
include/svx/svdograf.hxx
include/svx/svdogrp.hxx
include/svx/svdomeas.hxx
include/svx/svdomedia.hxx
include/svx/svdoole2.hxx
include/svx/svdopage.hxx
include/svx/svdopath.hxx
include/svx/svdorect.hxx
include/svx/svdotable.hxx
include/svx/svdotext.hxx
include/svx/svdouno.hxx
include/svx/svdoutl.hxx
include/svx/svdovirt.hxx
include/svx/svdpage.hxx
include/svx/svdundo.hxx
include/svx/unopage.hxx
include/svx/unoshape.hxx
include/svx/view3d.hxx
include/unotools/weakref.hxx
reportdesign/inc/RptObject.hxx
reportdesign/inc/RptPage.hxx
reportdesign/source/core/api/Shape.cxx
reportdesign/source/core/inc/ReportDrawPage.hxx
reportdesign/source/core/sdr/ReportDrawPage.cxx
reportdesign/source/core/sdr/RptObject.cxx
reportdesign/source/core/sdr/RptPage.cxx
reportdesign/source/core/sdr/UndoActions.cxx
reportdesign/source/ui/inc/UITools.hxx
reportdesign/source/ui/inc/dlgedfac.hxx
reportdesign/source/ui/misc/RptUndo.cxx
reportdesign/source/ui/misc/UITools.cxx
reportdesign/source/ui/report/ReportController.cxx
reportdesign/source/ui/report/ReportSection.cxx
reportdesign/source/ui/report/ViewsWindow.cxx
reportdesign/source/ui/report/dlgedfac.cxx
sc/CppunitTest_sc_shapetest.mk
sc/inc/postit.hxx
sc/qa/extras/anchor.cxx
sc/qa/unit/scshapetest.cxx
sc/qa/unit/ucalc.cxx
sc/qa/unit/ucalc_sort.cxx
sc/source/core/data/documen9.cxx
sc/source/core/data/drwlayer.cxx
sc/source/core/data/postit.cxx
sc/source/core/tool/detfunc.cxx
sc/source/filter/excel/xiescher.cxx
sc/source/filter/inc/xcl97rec.hxx
sc/source/filter/inc/xiescher.hxx
sc/source/filter/rtf/eeimpars.cxx
sc/source/ui/drawfunc/fuconarc.cxx
sc/source/ui/drawfunc/fuconcustomshape.cxx
sc/source/ui/drawfunc/fuconpol.cxx
sc/source/ui/drawfunc/fuconrec.cxx
sc/source/ui/drawfunc/fuconuno.cxx
sc/source/ui/drawfunc/fuins1.cxx
sc/source/ui/drawfunc/fuins2.cxx
sc/source/ui/drawfunc/fupoor.cxx
sc/source/ui/drawfunc/futext.cxx
sc/source/ui/drawfunc/graphsh.cxx
sc/source/ui/inc/fuconarc.hxx
sc/source/ui/inc/fuconcustomshape.hxx
sc/source/ui/inc/fuconpol.hxx
sc/source/ui/inc/fuconrec.hxx
sc/source/ui/inc/fuconuno.hxx
sc/source/ui/inc/fupoor.hxx
sc/source/ui/inc/futext.hxx
sc/source/ui/inc/notemark.hxx
sc/source/ui/undo/undocell.cxx
sc/source/ui/unoobj/TablePivotCharts.cxx
sc/source/ui/unoobj/chartuno.cxx
sc/source/ui/view/drawview.cxx
sc/source/ui/view/notemark.cxx
sc/source/ui/view/tabvwsh2.cxx
sc/source/ui/view/tabvwshb.cxx
sc/source/ui/view/tabvwshg.cxx
sc/source/ui/view/viewfun5.cxx
sc/source/ui/view/viewfun7.cxx
sd/inc/CustomAnimationEffect.hxx
sd/inc/Outliner.hxx
sd/inc/OutlinerIterator.hxx
sd/inc/sdpage.hxx
sd/inc/undo/undoobjects.hxx
sd/qa/unit/tiledrendering/tiledrendering.cxx
sd/source/core/CustomAnimationEffect.cxx
sd/source/core/sdpage.cxx
sd/source/core/sdpage2.cxx
sd/source/core/undo/undoobjects.cxx
sd/source/filter/pdf/sdpdffilter.cxx
sd/source/filter/ppt/pptin.cxx
sd/source/filter/ppt/pptin.hxx
sd/source/ui/animations/motionpathtag.cxx
sd/source/ui/animations/motionpathtag.hxx
sd/source/ui/dlg/animobjs.cxx
sd/source/ui/func/fucon3d.cxx
sd/source/ui/func/fuconarc.cxx
sd/source/ui/func/fuconbez.cxx
sd/source/ui/func/fuconcs.cxx
sd/source/ui/func/fuconrec.cxx
sd/source/ui/func/fuconuno.cxx
sd/source/ui/func/fuinsert.cxx
sd/source/ui/func/fuinsfil.cxx
sd/source/ui/func/fulinend.cxx
sd/source/ui/func/fumorph.cxx
sd/source/ui/func/fupoor.cxx
sd/source/ui/func/futext.cxx
sd/source/ui/func/fuvect.cxx
sd/source/ui/inc/OutlinerIteratorImpl.hxx
sd/source/ui/inc/fucon3d.hxx
sd/source/ui/inc/fuconarc.hxx
sd/source/ui/inc/fuconbez.hxx
sd/source/ui/inc/fuconcs.hxx
sd/source/ui/inc/fuconrec.hxx
sd/source/ui/inc/fuconuno.hxx
sd/source/ui/inc/fupoor.hxx
sd/source/ui/inc/futext.hxx
sd/source/ui/inc/unopage.hxx
sd/source/ui/table/tablefunction.cxx
sd/source/ui/unoidl/unoobj.cxx
sd/source/ui/unoidl/unopage.cxx
sd/source/ui/view/DocumentRenderer.cxx
sd/source/ui/view/GraphicObjectBar.cxx
sd/source/ui/view/Outliner.cxx
sd/source/ui/view/OutlinerIterator.cxx
sd/source/ui/view/drviews2.cxx
sd/source/ui/view/drviews6.cxx
sd/source/ui/view/drviews8.cxx
sd/source/ui/view/drviews9.cxx
sd/source/ui/view/drviewsa.cxx
sd/source/ui/view/drviewse.cxx
sd/source/ui/view/sdview.cxx
sd/source/ui/view/sdview2.cxx
sd/source/ui/view/sdview3.cxx
sd/source/ui/view/sdview4.cxx
sd/source/ui/view/viewoverlaymanager.cxx
sfx2/source/doc/sfxbasemodel.cxx
svx/inc/extrud3d.hxx
svx/inc/polygn3d.hxx
svx/inc/sdr/primitive2d/sdrolecontentprimitive2d.hxx
svx/qa/unit/customshapes.cxx
svx/qa/unit/svdraw.cxx
svx/source/core/extedit.cxx
svx/source/customshapes/EnhancedCustomShape2d.cxx
svx/source/customshapes/EnhancedCustomShape3d.cxx
svx/source/customshapes/EnhancedCustomShape3d.hxx
svx/source/customshapes/EnhancedCustomShapeEngine.cxx
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
svx/source/customshapes/EnhancedCustomShapeFontWork.hxx
svx/source/dialog/compressgraphicdialog.cxx
svx/source/dialog/connctrl.cxx
svx/source/dialog/contwnd.cxx
svx/source/dialog/dlgctl3d.cxx
svx/source/dialog/dlgctrl.cxx
svx/source/dialog/imapwnd.cxx
svx/source/dialog/imapwnd.hxx
svx/source/dialog/measctrl.cxx
svx/source/engine3d/cube3d.cxx
svx/source/engine3d/extrud3d.cxx
svx/source/engine3d/float3d.cxx
svx/source/engine3d/lathe3d.cxx
svx/source/engine3d/obj3d.cxx
svx/source/engine3d/objfac3d.cxx
svx/source/engine3d/polygn3d.cxx
svx/source/engine3d/scene3d.cxx
svx/source/engine3d/sphere3d.cxx
svx/source/engine3d/view3d.cxx
svx/source/engine3d/view3d1.cxx
svx/source/form/fmdmod.cxx
svx/source/form/fmdpage.cxx
svx/source/form/fmobj.cxx
svx/source/form/fmobjfac.cxx
svx/source/form/fmpage.cxx
svx/source/form/fmview.cxx
svx/source/form/fmvwimp.cxx
svx/source/gallery2/galtheme.cxx
svx/source/inc/fmobj.hxx
svx/source/inc/fmvwimp.hxx
svx/source/inc/svdpdf.hxx
svx/source/sdr/contact/viewcontactofgraphic.cxx
svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
svx/source/svdraw/selectioncontroller.cxx
svx/source/svdraw/svdcrtv.cxx
svx/source/svdraw/svddrgmt.cxx
svx/source/svdraw/svdedtv.cxx
svx/source/svdraw/svdedtv2.cxx
svx/source/svdraw/svdedxv.cxx
svx/source/svdraw/svdetc.cxx
svx/source/svdraw/svdfmtf.cxx
svx/source/svdraw/svdfmtf.hxx
svx/source/svdraw/svdmodel.cxx
svx/source/svdraw/svdoashp.cxx
svx/source/svdraw/svdobj.cxx
svx/source/svdraw/svdocapt.cxx
svx/source/svdraw/svdocirc.cxx
svx/source/svdraw/svdoedge.cxx
svx/source/svdraw/svdograf.cxx
svx/source/svdraw/svdogrp.cxx
svx/source/svdraw/svdomeas.cxx
svx/source/svdraw/svdomedia.cxx
svx/source/svdraw/svdoole2.cxx
svx/source/svdraw/svdopage.cxx
svx/source/svdraw/svdopath.cxx
svx/source/svdraw/svdorect.cxx
svx/source/svdraw/svdotext.cxx
svx/source/svdraw/svdotxln.cxx
svx/source/svdraw/svdotxtr.cxx
svx/source/svdraw/svdouno.cxx
svx/source/svdraw/svdoutl.cxx
svx/source/svdraw/svdovirt.cxx
svx/source/svdraw/svdpage.cxx
svx/source/svdraw/svdpdf.cxx
svx/source/svdraw/svdpoev.cxx
svx/source/svdraw/svdundo.cxx
svx/source/svdraw/svdxcgv.cxx
svx/source/table/svdotable.cxx
svx/source/table/tablecontroller.cxx
svx/source/table/tableundo.cxx
svx/source/table/tableundo.hxx
svx/source/tbxctrls/fontworkgallery.cxx
svx/source/unodraw/UnoGraphicExporter.cxx
svx/source/unodraw/gluepts.cxx
svx/source/unodraw/unopage.cxx
svx/source/unodraw/unoshap2.cxx
svx/source/unodraw/unoshap3.cxx
svx/source/unodraw/unoshape.cxx
sw/inc/anchoredobject.hxx
sw/inc/dcontact.hxx
sw/inc/dobjfac.hxx
sw/inc/dpage.hxx
sw/inc/unodraw.hxx
sw/source/core/doc/doclay.cxx
sw/source/core/draw/dcontact.cxx
sw/source/core/draw/dflyobj.cxx
sw/source/core/draw/dobjfac.cxx
sw/source/core/draw/dpage.cxx
sw/source/core/draw/drawdoc.cxx
sw/source/core/frmedt/fecopy.cxx
sw/source/core/frmedt/feshview.cxx
sw/source/core/inc/dflyobj.hxx
sw/source/core/layout/anchoredobject.cxx
sw/source/core/layout/fly.cxx
sw/source/core/unocore/unodraw.cxx
sw/source/filter/html/htmldrawreader.cxx
sw/source/filter/html/htmltab.cxx
sw/source/filter/html/swhtml.cxx
sw/source/filter/html/swhtml.hxx
sw/source/filter/ww8/docxsdrexport.cxx
sw/source/filter/ww8/wrtww8gr.cxx
sw/source/filter/ww8/ww8graf.cxx
sw/source/filter/ww8/ww8graf2.cxx
sw/source/filter/ww8/ww8par.cxx
sw/source/filter/ww8/ww8par.hxx
sw/source/filter/ww8/ww8par4.cxx
sw/source/filter/xml/swxml.cxx
sw/source/uibase/dochdl/swdtflvr.cxx
sw/source/uibase/shells/drawsh.cxx
sw/source/uibase/shells/grfshex.cxx
sw/source/uibase/uiview/viewdraw.cxx