From 3a2176ae256643a3b8c42bca33d333aecad61d19 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 12 Sep 2022 17:01:43 +0200 Subject: 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 Reviewed-by: Noel Grandin --- svx/source/svdraw/svdotext.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'svx/source/svdraw/svdotext.cxx') 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 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 { -- cgit