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.grandin@collabora.co.uk>
This commit is contained in:
@@ -129,6 +129,7 @@ enum class SfxHintId {
|
||||
ScTables,
|
||||
ScEditView,
|
||||
ScUnoRefUndo,
|
||||
ScBulkData,
|
||||
|
||||
// SC accessibility hints
|
||||
ScAccTableChanged,
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user