include/svl/hint.hxx                      |    1 +
 sc/inc/bulkdatahint.hxx                   |    4 ++--
 sc/source/core/data/bcaslot.cxx           |    6 +++---
 sc/source/core/inc/bcaslot.hxx            |    2 +-
 sc/source/core/tool/grouparealistener.cxx |    5 ++---
 5 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b1309730b8a5419d48a29edf6d3caf524311ed2e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Sep 4 12:47:25 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Sep 4 20:03:40 2024 +0200

    use less dynamic_cast when broadcasting BulkDataHint
    
    we never read the hint id that we pass in to the constructor, so drop it
    
    Change-Id: I8ec377e51bddbc2a12a2fd226fc1a915afef59e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172862
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
index 81600f610484..bad64aa212fc 100644
--- a/include/svl/hint.hxx
+++ b/include/svl/hint.hxx
@@ -129,6 +129,7 @@ enum class SfxHintId {
     ScTables,
     ScEditView,
     ScUnoRefUndo,
+    ScBulkData,
 
 // SC accessibility hints
     ScAccTableChanged,
diff --git a/sc/inc/bulkdatahint.hxx b/sc/inc/bulkdatahint.hxx
index e77ef317ef72..24227da70dcb 100644
--- a/sc/inc/bulkdatahint.hxx
+++ b/sc/inc/bulkdatahint.hxx
@@ -23,8 +23,8 @@ class BulkDataHint final : public SfxHint
     const ColumnSpanSet* mpSpans;
 
 public:
-    BulkDataHint(ScDocument& rDoc, SfxHintId nHintId)
-        : SfxHint(nHintId)
+    BulkDataHint(ScDocument& rDoc)
+        : SfxHint(SfxHintId::ScBulkData)
         , mrDoc(rDoc)
         , mpSpans(nullptr)
     {
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 209eb9f2a9ba..c89d44356d8a 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -1145,7 +1145,7 @@ void ScBroadcastAreaSlotMachine::LeaveBulkBroadcast( 
SfxHintId nHintId )
     if (--nInBulkBroadcast == 0)
     {
         ScBroadcastAreasBulk().swap( aBulkBroadcastAreas);
-        bool bBroadcasted = BulkBroadcastGroupAreas( nHintId );
+        bool bBroadcasted = BulkBroadcastGroupAreas();
         // Trigger the "final" tracking.
         if (pDoc->IsTrackFormulasPending())
             pDoc->FinalTrackFormulas( nHintId );
@@ -1172,12 +1172,12 @@ void ScBroadcastAreaSlotMachine::InsertBulkGroupArea( 
ScBroadcastArea* pArea, co
     rSet.set(*pDoc, rRange, true);
 }
 
-bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas( SfxHintId nHintId )
+bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas()
 {
     if (m_BulkGroupAreas.empty())
         return false;
 
-    sc::BulkDataHint aHint( *pDoc, nHintId);
+    sc::BulkDataHint aHint( *pDoc );
 
     bool bBroadcasted = false;
     for (const auto& [pArea, rSpans] : m_BulkGroupAreas)
diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx
index 6e891e8aab5a..fc36127904d0 100644
--- a/sc/source/core/inc/bcaslot.hxx
+++ b/sc/source/core/inc/bcaslot.hxx
@@ -348,7 +348,7 @@ public:
 
     void InsertBulkGroupArea( ScBroadcastArea* pArea, const ScRange& rRange );
     void RemoveBulkGroupArea( ScBroadcastArea* pArea );
-    bool BulkBroadcastGroupAreas( SfxHintId nHintId );
+    bool BulkBroadcastGroupAreas();
 
     /// @return: how many removed
     size_t              RemoveBulkArea( const ScBroadcastArea* p );
diff --git a/sc/source/core/tool/grouparealistener.cxx 
b/sc/source/core/tool/grouparealistener.cxx
index 4954ce8d8d0f..092d0de62ad8 100644
--- a/sc/source/core/tool/grouparealistener.cxx
+++ b/sc/source/core/tool/grouparealistener.cxx
@@ -117,10 +117,9 @@ ScRange FormulaGroupAreaListener::getListeningRange() const
 
 void FormulaGroupAreaListener::Notify( const SfxHint& rHint )
 {
-    // BulkDataHint may include (SfxHintId::ScDataChanged |
-    // SfxHintId::ScTableOpDirty) so has to be checked first.
-    if ( const BulkDataHint* pBulkHint = dynamic_cast<const 
BulkDataHint*>(&rHint) )
+    if ( rHint.GetId() == SfxHintId::ScBulkData )
     {
+        const BulkDataHint* pBulkHint = static_cast<const 
BulkDataHint*>(&rHint);
         notifyBulkChange(*pBulkHint);
     }
     else if (rHint.GetId() == SfxHintId::ScDataChanged || rHint.GetId() == 
SfxHintId::ScTableOpDirty)

Reply via email to