diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-05-28 18:25:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-29 11:19:41 +0200 |
commit | 7449378435627e466e69c2becd07b17ad7d7ff9b (patch) | |
tree | 3222871507344739df0ac460b97dd31d99334e7d | |
parent | db94d1079a83eae9ac0c8d92f4547698d016daf8 (diff) |
avoid dynamic_cast in SwTextNode
Change-Id: Id7ee5e922b7e99d1f3bade3b94285283eb07ae68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168163
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
-rw-r--r-- | include/svl/hint.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/attrhint.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index fc54ac23fc99..0a7459175905 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -160,6 +160,7 @@ enum class SfxHintId { SwFormatField, SwFindRedline, SwModifyChanged, + SwAttr, ThisIsAnSdrHint, ThisIsAnSfxEventHint @@ -252,6 +253,7 @@ inline std::basic_ostream<charT, traits> & operator <<( case SfxHintId::SwFormatField: return stream << "SwFormatField"; case SfxHintId::SwFindRedline: return stream << "SwFindRedline"; case SfxHintId::SwModifyChanged: return stream << "SwModifyChanged"; + case SfxHintId::SwAttr: return stream << "SwAttr"; case SfxHintId::ThisIsAnSdrHint: return stream << "SdrHint"; default: return stream << "unk(" << std::to_string(int(id)) << ")"; } diff --git a/sw/source/core/inc/attrhint.hxx b/sw/source/core/inc/attrhint.hxx index e098b2695244..261839c5bbc4 100644 --- a/sw/source/core/inc/attrhint.hxx +++ b/sw/source/core/inc/attrhint.hxx @@ -24,6 +24,11 @@ class SwAttrHint final : public SfxHint { +public: + SwAttrHint() + : SfxHint(SfxHintId::SwAttr) + { + } }; #endif diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 1d71a1cd8169..4cb8534ab205 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -5552,7 +5552,7 @@ void SwTextNode::SwClientNotify( const SwModify& rModify, const SfxHint& rHint ) auto pLegacyHint = static_cast<const sw::LegacyModifyHint*>(&rHint); TriggerNodeUpdate(*pLegacyHint); } - else if (dynamic_cast<const SwAttrHint*>(&rHint)) + else if (rHint.GetId() == SfxHintId::SwAttr) { if (&rModify == GetRegisteredIn()) ChkCondColl(); |