Resolves: tdf#93171 follow-up, notify dependents of subtotal formula cells

Track ScHiddenRowsChanged collected cells and broadcast with ScDataChanged.

Change-Id: Id41d2731585f6749533319bf42ad655a845ecf30
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 342fff0..299f5e7 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -559,7 +559,8 @@ void ScDocument::TrackFormulas( SfxHintId nHintId )
    if (!pBASM)
        return;

    if (pBASM->IsInBulkBroadcast() && !IsFinalTrackFormulas() && nHintId == SfxHintId::ScDataChanged)
    if (pBASM->IsInBulkBroadcast() && !IsFinalTrackFormulas() &&
            (nHintId == SfxHintId::ScDataChanged || nHintId == SfxHintId::ScHiddenRowsChanged))
    {
        SetTrackFormulasPending();
        return;
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index f64e2dc..d6c7a85 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -40,6 +40,7 @@
#include "globalnames.hxx"
#include "scmod.hxx"
#include "printopt.hxx"
#include "bcaslot.hxx"

#include <com/sun/star/sheet/TablePageBreakData.hpp>

@@ -593,9 +594,17 @@ bool ScTable::SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden)
    {
        if (IsStreamValid())
            SetStreamValid(false);
        for (SCCOL i = 0; i < aCol.size(); i++)
        {
            aCol[i].BroadcastRows(nStartRow, nEndRow, SfxHintId::ScHiddenRowsChanged);

        {   // Scoped bulk broadcast.
            // Only subtotal formula cells will accept the notification of
            // SfxHintId::ScHiddenRowsChanged, leaving the bulk will track
            // those and broadcast SfxHintId::ScDataChanged to notify all
            // dependents.
            ScBulkBroadcast aBulkBroadcast( pDocument->GetBASM(), SfxHintId::ScDataChanged);
            for (SCCOL i = 0; i < aCol.size(); i++)
            {
                aCol[i].BroadcastRows(nStartRow, nEndRow, SfxHintId::ScHiddenRowsChanged);
            }
        }
    }