[Libreoffice-commits] core.git: sw/source

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 17 21:43:19 UTC 2020


 sw/source/core/doc/acmplwrd.cxx |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit afa1479e3dfe185f6ebe3c5217cbf1bdb7374eff
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Tue Oct 6 22:03:47 2020 +0200
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Sat Oct 17 23:42:43 2020 +0200

    SwAutoCompleteClient: Modify no more ...
    
    Change-Id: Iec2a869de825b81c8e7b81dec746fa68e11ef864
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104045
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 720dfd6c9120..ebf380b6e081 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -55,7 +55,7 @@ public:
     static sal_uLong GetElementCount() {return s_nSwAutoCompleteClientCount;}
 #endif
 protected:
-    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
+    virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
 };
 
 class SwAutoCompleteWord_Impl
@@ -131,16 +131,17 @@ SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient
     return *this;
 }
 
-void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *)
+void SwAutoCompleteClient::SwClientNotify(const SwModify&, const SfxHint& rHint)
 {
-    switch( pOld ? pOld->Which() : 0 )
+    auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
+    if(!pLegacy)
+        return;
+    switch(pLegacy->GetWhich())
     {
-    case RES_REMOVE_UNO_OBJECT:
-    case RES_OBJECTDYING:
-        if( static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject )
+        case RES_REMOVE_UNO_OBJECT:
+        case RES_OBJECTDYING:
             EndListeningAll();
-        m_pAutoCompleteWord->DocumentDying(*m_pDoc);
-        break;
+            m_pAutoCompleteWord->DocumentDying(*m_pDoc);
     }
 }
 


More information about the Libreoffice-commits mailing list