diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 538f1609836a..a6136a4db141 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -57,7 +57,7 @@ class SW_DLLPUBLIC SwNumFormat final : public SvxNumberFormat, public SwClient using SvxNumberFormat::operator ==; using SvxNumberFormat::operator !=; - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override; + virtual void SwClientNotify(const SwModify&, const SfxHint&) override; public: SwNumFormat(); diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 66ff2976ca75..10e6a9695291 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -278,24 +278,26 @@ void SwNumFormat::SetCharFormat( SwCharFormat* pChFormat) EndListeningAll(); } -void SwNumFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) +void SwNumFormat::SwClientNotify(const SwModify&, const SfxHint& rHint) { + auto pLegacy = dynamic_cast(&rHint); + if(!pLegacy) + return; // Look for the NumRules object in the Doc where this NumFormat is set. // The format does not need to exist! const SwCharFormat* pFormat = nullptr; - sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; - switch( nWhich ) + switch(pLegacy->GetWhich()) { - case RES_ATTRSET_CHG: - case RES_FMT_CHG: - pFormat = GetCharFormat(); - break; + case RES_ATTRSET_CHG: + case RES_FMT_CHG: + pFormat = GetCharFormat(); + break; } - if( pFormat && !pFormat->GetDoc()->IsInDtor() ) - UpdateNumNodes( *const_cast(pFormat->GetDoc()) ); + if(pFormat && !pFormat->GetDoc()->IsInDtor()) + UpdateNumNodes(*const_cast(pFormat->GetDoc())); else - CheckRegistration( pOld ); + CheckRegistration(pLegacy->m_pOld); } OUString SwNumFormat::GetCharFormatName() const