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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Sun Dec 6 00:57:31 UTC 2020


 sw/inc/swevent.hxx |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit d589d0caa36f95db8a890e476b9337c9e98fe26d
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sun Dec 6 00:13:42 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Sun Dec 6 01:56:49 2020 +0100

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

diff --git a/sw/inc/swevent.hxx b/sw/inc/swevent.hxx
index 558f834a9f9c..425db6b6e3f6 100644
--- a/sw/inc/swevent.hxx
+++ b/sw/inc/swevent.hxx
@@ -116,18 +116,24 @@ struct SwCallMouseEvent final
 
     bool HasEvent() const { return EVENT_OBJECT_NONE != eType; }
 
-    virtual void Modify(SfxPoolItem const*const pOldValue, SfxPoolItem const*const pNewValue) override
+    virtual void SwClientNotify(const SwModify& rMod, const SfxHint& rHint) override
     {
+        auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
+        if(!pLegacy)
+            return;
         assert(EVENT_OBJECT_IMAGE == eType || EVENT_OBJECT_URLITEM == eType || EVENT_OBJECT_IMAGEMAP == eType);
-        SwClient::Modify(pOldValue, pNewValue);
-        if (!GetRegisteredIn()
-            || (RES_FMT_CHG == pOldValue->Which()
-                && static_cast<SwFormatChg const*>(pOldValue)->pChangedFormat == PTR.pFormat)
-            || (RES_REMOVE_UNO_OBJECT == pOldValue->Which()
-                && static_cast<SwPtrMsgPoolItem const*>(pOldValue)->pObject == PTR.pFormat))
+        SwClient::SwClientNotify(rMod, rHint);
+        bool bClear = !GetRegisteredIn();
+        switch(pLegacy->GetWhich())
         {
-            Clear();
+            case RES_FMT_CHG:
+                bClear |= static_cast<SwFormatChg const*>(pLegacy->m_pOld)->pChangedFormat == PTR.pFormat;
+                break;
+            case RES_REMOVE_UNO_OBJECT:
+                bClear |= static_cast<SwPtrMsgPoolItem const*>(pLegacy->m_pOld)->pObject == PTR.pFormat;
         }
+        if(bClear)
+            Clear();
     }
 };
 


More information about the Libreoffice-commits mailing list