diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-21 14:38:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-21 20:01:56 +0200 |
commit | 7d188fe4639717df47e2ff72d8c1295e23862ef9 (patch) | |
tree | e14e3f5dd16fdf858bdc41f75e3f3a501aa9f40e /sw/inc | |
parent | 612db1ec6b74bf10df8d8ce1740a8a10602f0722 (diff) |
create SfxHintId::SwLegacyModify id
to avoid expensive dynamic_casts in writer
Change-Id: Ic73ae7d4af985043f8533913b33939e3445ec7de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117586
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/calbck.hxx | 2 | ||||
-rw-r--r-- | sw/inc/swevent.hxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 0863b2da7f2f..2d873107e069 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -68,7 +68,7 @@ namespace sw void ClientNotifyAttrChg(SwModify& rModify, const SwAttrSet& aSet, SwAttrSet& aOld, SwAttrSet& aNew); struct LegacyModifyHint final: SfxHint { - LegacyModifyHint(const SfxPoolItem* pOld, const SfxPoolItem* pNew) : m_pOld(pOld), m_pNew(pNew) {}; + LegacyModifyHint(const SfxPoolItem* pOld, const SfxPoolItem* pNew) : SfxHint(SfxHintId::SwLegacyModify), m_pOld(pOld), m_pNew(pNew) {}; sal_uInt16 GetWhich() const { return m_pOld ? m_pOld->Which() : m_pNew ? m_pNew->Which() : 0; }; virtual ~LegacyModifyHint() override; const SfxPoolItem* m_pOld; diff --git a/sw/inc/swevent.hxx b/sw/inc/swevent.hxx index e18020320544..b25246cb2e12 100644 --- a/sw/inc/swevent.hxx +++ b/sw/inc/swevent.hxx @@ -118,9 +118,9 @@ struct SwCallMouseEvent final virtual void SwClientNotify(const SwModify& rMod, const SfxHint& rHint) override { - auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint); - if(!pLegacy) + if (rHint.GetId() != SfxHintId::SwLegacyModify) return; + auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint); assert(EVENT_OBJECT_IMAGE == eType || EVENT_OBJECT_URLITEM == eType || EVENT_OBJECT_IMAGEMAP == eType); SwClient::SwClientNotify(rMod, rHint); bool bClear = !GetRegisteredIn(); |