summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-05-28 18:34:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-29 12:55:07 +0200
commit3a604beae75a1157e9bb4cf620cc7ad4d007ab45 (patch)
treed5a601eecac4b3d5d718cda8fc458a98a7d56763 /sw
parent73eed7cfe08624227214378c50e2f09c9a868ee3 (diff)
avoid dynamic_cast in SwTOXBase
Change-Id: Iac8f502bf200f599d44f52504a3b70a1a21b370b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168164 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/hints.hxx2
-rw-r--r--sw/inc/tox.hxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx
index fa7a78200a26..a63ed932e944 100644
--- a/sw/inc/hints.hxx
+++ b/sw/inc/hints.hxx
@@ -218,6 +218,8 @@ public:
class DocumentDyingHint final : public SfxHint
{
+public:
+ DocumentDyingHint() : SfxHint(SfxHintId::SwDocumentDying) {}
};
class TableLineFormatChanged final : public SfxHint
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index bd5e89101341..44d392909341 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -465,7 +465,7 @@ public:
virtual void SwClientNotify(const SwModify& rMod, const SfxHint& rHint) override
{
- if(dynamic_cast<const sw::DocumentDyingHint*>(&rHint))
+ if(rHint.GetId() == SfxHintId::SwDocumentDying)
GetRegisteredIn()->Remove(*this);
else
SwClient::SwClientNotify(rMod, rHint);