diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2018-01-25 02:21:24 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2018-01-25 02:21:24 +0100 |
commit | 5872783c90250ad7c5794a1eafa0a1d7ef19dc6a (patch) | |
tree | 97bf090b506f80c5a1445e410c786c023d6b1b54 | |
parent | 2caa5e4247b1076961510682a0340657050d49b3 (diff) |
more GetRegisteredIn obsoleted by StopListeningAll()
Change-Id: I7d69a5112e03cec1b8ebdc389940557b4dbd1117
-rw-r--r-- | sw/source/core/doc/lineinfo.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/para/paratr.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/txtnode/SwGrammarContact.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 8 |
7 files changed, 20 insertions, 21 deletions
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx index d8cf7439a38e..f8599bd94f1d 100644 --- a/sw/source/core/doc/lineinfo.cxx +++ b/sw/source/core/doc/lineinfo.cxx @@ -84,8 +84,8 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy) { if ( rCpy.GetRegisteredIn() ) const_cast<SwModify*>(rCpy.GetRegisteredIn())->Add( this ); - else if ( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + else + EndListeningAll(); aType = rCpy.GetNumType(); aDivider = rCpy.GetDivider(); diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index b60a20168802..8912e30363b7 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -217,8 +217,8 @@ SwNumFormat::SwNumFormat(const SvxNumberFormat& rNumFormat, SwDoc* pDoc) } pCFormat->Add( this ); } - else if( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + else + EndListeningAll(); } SwNumFormat::~SwNumFormat() @@ -259,8 +259,8 @@ SwNumFormat& SwNumFormat::operator=( const SwNumFormat& rNumFormat) SvxNumberFormat::operator=(rNumFormat); if( rNumFormat.GetRegisteredIn() ) rNumFormat.GetRegisteredInNonConst()->Add( this ); - else if( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + else + EndListeningAll(); //For i120928,record the cp info of graphic within bullet m_cGrfBulletCP = rNumFormat.m_cGrfBulletCP; return *this; @@ -277,8 +277,8 @@ void SwNumFormat::SetCharFormat( SwCharFormat* pChFormat) { if( pChFormat ) pChFormat->Add( this ); - else if( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + else + EndListeningAll(); } void SwNumFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 03e262ee2eb7..8e0636759083 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1042,7 +1042,7 @@ void SwContentNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNe else { // Else register anyways when dying - GetRegisteredIn()->Remove( this ); + EndListeningAll(); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, nullptr, nullptr ); } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index dc16db754289..dbf74b41e7aa 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2055,16 +2055,16 @@ void SwFormatChain::SetPrev( SwFlyFrameFormat *pFormat ) { if ( pFormat ) pFormat->Add( &aPrev ); - else if ( aPrev.GetRegisteredIn() ) - aPrev.GetRegisteredIn()->Remove( &aPrev ); + else + aPrev.EndListeningAll(); } void SwFormatChain::SetNext( SwFlyFrameFormat *pFormat ) { if ( pFormat ) pFormat->Add( &aNext ); - else if ( aNext.GetRegisteredIn() ) - aNext.GetRegisteredIn()->Remove( &aNext ); + else + aNext.EndListeningAll(); } bool SwFormatChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx index 68dc9bd1c5df..f66b388ffabe 100644 --- a/sw/source/core/para/paratr.cxx +++ b/sw/source/core/para/paratr.cxx @@ -66,8 +66,7 @@ void SwFormatDrop::SetCharFormat( SwCharFormat *pNew ) { assert(!pNew || !pNew->IsDefault()); // expose cases that lead to use-after-free // Rewire - if ( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + EndListeningAll(); if(pNew) pNew->Add( this ); } diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx index 78ea24427659..d1ae37a7571d 100644 --- a/sw/source/core/txtnode/SwGrammarContact.cxx +++ b/sw/source/core/txtnode/SwGrammarContact.cxx @@ -94,7 +94,7 @@ void SwGrammarContact::updateCursorPosition( const SwPosition& rNewPos ) getMyTextNode()->SetGrammarCheck( mpProxyList ); SwTextFrame::repaintTextFrames( *getMyTextNode() ); } - GetRegisteredInNonConst()->Remove( this ); // good bye old paragraph + EndListeningAll(); mpProxyList = nullptr; } if( pTextNode ) @@ -152,7 +152,7 @@ void SwGrammarContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem * ) if( pDead->pObject == GetRegisteredIn() ) { // if my current paragraph dies, I throw the proxy list away aTimer.Stop(); - GetRegisteredInNonConst()->Remove( this ); + EndListeningAll(); delete mpProxyList; mpProxyList = nullptr; } diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 7879abfd302c..a833dbe064f3 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -158,8 +158,8 @@ SwCharFormat* SwTextINetFormat::GetCharFormat() if ( pRet ) pRet->Add( this ); - else if ( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + else + EndListeningAll(); return pRet; } @@ -277,8 +277,8 @@ SwCharFormat* SwTextRuby::GetCharFormat() if( pRet ) pRet->Add( this ); - else if( GetRegisteredIn() ) - GetRegisteredInNonConst()->Remove( this ); + else + EndListeningAll(); return pRet; } |