sw/inc/numrule.hxx            |    2 +-
 sw/source/core/doc/number.cxx |   22 ++++++++++++----------
 2 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 22ca1a3c646851eb584edb59e2db7b53961d0094
Author:     Bjoern Michaelsen <bjoern.michael...@libreoffice.org>
AuthorDate: Wed Oct 28 21:21:42 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michael...@libreoffice.org>
CommitDate: Thu Oct 29 20:07:49 2020 +0100

    SwNumFormat: Modify no more ...
    
    Change-Id: Icda36d5226a2eca63b9ed56ac9ac5be768a4d117
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104977
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michael...@libreoffice.org>

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<const sw::LegacyModifyHint*>(&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<SwDoc*>(pFormat->GetDoc()) );
+    if(pFormat && !pFormat->GetDoc()->IsInDtor())
+        UpdateNumNodes(*const_cast<SwDoc*>(pFormat->GetDoc()));
     else
-        CheckRegistration( pOld );
+        CheckRegistration(pLegacy->m_pOld);
 }
 
 OUString SwNumFormat::GetCharFormatName() const
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to