diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-12 17:01:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-14 11:22:49 +0200 |
commit | 3a2176ae256643a3b8c42bca33d333aecad61d19 (patch) | |
tree | 1a67f920f34141ffe485cedf5bcec74b9f878bbf /svx/source/svdraw/svdotext.cxx | |
parent | 58cb4fc7d17ae5b339c5ed6ae139e6ef2433c927 (diff) |
new loplugin refcountingbase
Look for classes that have more than one ref-counting base class.
A situation which is going to cause trouble.
Which reveals that sdr::table::Cell has two different ref-counting bases,
so rather make SdrText extends OWeakObject, which means
that Cell can just have one ref-counting base,
Change-Id: I8d968270f7b449cff2f29da0bd48fa17181c68c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139807
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdotext.cxx')
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 24223aaee738..53b32ddf28b2 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -193,7 +193,7 @@ SdrTextObj::SdrTextObj(SdrModel& rSdrModel, SdrObjKind eNewTextKind, SdrTextObj::~SdrTextObj() { - mpText.reset(); + mxText.clear(); ImpDeregisterLink(); } @@ -2047,10 +2047,10 @@ rtl::Reference<SdrObject> SdrTextObj::getFullDragClone() const /** returns the currently active text. */ SdrText* SdrTextObj::getActiveText() const { - if( !mpText ) + if( !mxText ) return getText( 0 ); else - return mpText.get(); + return mxText.get(); } /** returns the nth available text. */ @@ -2058,9 +2058,9 @@ SdrText* SdrTextObj::getText( sal_Int32 nIndex ) const { if( nIndex == 0 ) { - if( !mpText ) - const_cast< SdrTextObj* >(this)->mpText.reset( new SdrText( *const_cast< SdrTextObj* >(this) ) ); - return mpText.get(); + if( !mxText ) + const_cast< SdrTextObj* >(this)->mxText = new SdrText( *const_cast< SdrTextObj* >(this) ); + return mxText.get(); } else { |