diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-04 11:11:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-05 08:10:26 +0200 |
commit | ac9eaf5d11e5f44d7faa628233438a3b1bb89d6f (patch) | |
tree | a4ecd3dc27a4d24176442ebe6f9aedc9ad05cd8f /sc/source/ui | |
parent | 0266763e05d1ca9413321533dcea73c4643db476 (diff) |
use less dynamic_cast when broadcasting SfxHint
Change-Id: If4d33cbbf36a9ad495b80a7347b39d0f4bc0405e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172857
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/docshell/servobj.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index 4367c7140cc9..78b83a00179a 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -227,11 +227,11 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { // must be from Area broadcasters - const ScHint* pScHint = dynamic_cast<const ScHint*>( &rHint ); - if (pScHint && (pScHint->GetId() == SfxHintId::ScDataChanged)) + if (rHint.GetId() == SfxHintId::ScDataChanged) bDataChanged = true; - else if (const ScAreaChangedHint *pChgHint = dynamic_cast<const ScAreaChangedHint*>(&rHint)) // position of broadcaster changed + else if (rHint.GetId() == SfxHintId::ScAreaChanged) // position of broadcaster changed { + const ScAreaChangedHint *pChgHint = static_cast<const ScAreaChangedHint*>(&rHint); const ScRange& aNewRange = pChgHint->GetRange(); if ( aRange != aNewRange ) { @@ -239,15 +239,12 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) bDataChanged = true; } } - else + else if (rHint.GetId() == SfxHintId::Dying) { - if (rHint.GetId() == SfxHintId::Dying) - { - // If the range is being deleted, listening must be restarted - // after the deletion is complete (done in GetData) - bRefreshListener = true; - bDataChanged = true; - } + // If the range is being deleted, listening must be restarted + // after the deletion is complete (done in GetData) + bRefreshListener = true; + bDataChanged = true; } } |