22 #include <document.hxx>
27 #include <progress.hxx>
31 #include <tokenarray.hxx>
49 pBASM->StartListeningArea(rRange, bGroupListening, pListener);
57 pBASM->StartListeningArea( aLimitedRange, bGroupListening, pListener);
71 pBASM->EndListeningArea(rRange, bGroupListening, pListener);
79 pBASM->EndListeningArea( aLimitedRange, bGroupListening, pListener);
83 bool& o_bEntirelyOutOfBounds )
const
96 SAL_WARN(
"sc.core",
"ScDocument::LimitRangeToAvailableSheets - bad sheet range: " << nTab1 <<
".." << nTab2 <<
97 ", sheets: 0.." << nMaxTab);
100 if ((nTab1 < 0 && nTab2 < 0) || (nMaxTab < nTab1 && nMaxTab < nTab2))
102 o_bEntirelyOutOfBounds =
true;
107 o_bEntirelyOutOfBounds =
false;
108 nTab1 = std::clamp<SCTAB>( nTab1, 0, nMaxTab);
109 nTab2 = std::clamp<SCTAB>( nTab2, 0, nMaxTab);
112 o_rRange.aEnd.SetTab(nTab2);
123 bool bIsBroadcasted =
false;
128 bIsBroadcasted =
true;
130 if (
pBASM->AreaBroadcast( rHint ) || bIsBroadcasted )
137 if (nTab < static_cast<SCTAB>(
maTabs.size()) &&
maTabs[nTab])
138 maTabs[nTab]->SetStreamValid(
false);
159 bool bIsBroadcasted =
false;
161 if (bBroadcastSingleBroadcasters)
165 for (
SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
175 if (
pBASM->AreaBroadcast(rRange, nHint) || bIsBroadcasted)
179 for (
SCTAB nTab = nTab1; nTab <= nTab2; ++nTab)
196 if (
pBASM->AreaBroadcast( rHint ) )
204 pBASM->DelBroadcastAreasInRange( rRange );
210 OSL_ENSURE(pListener,
"StartListeningCell: pListener Null");
213 maTabs[nTab]->StartListening( rAddress, pListener );
219 OSL_ENSURE(pListener,
"EndListeningCell: pListener Null");
222 maTabs[nTab]->EndListening( rAddress, pListener );
251 for (
auto& pCell : rCells)
252 pCell->EndListeningTo(aCxt);
259 OSL_ENSURE( pCell,
"PutInFormulaTree: pCell Null" );
276 OSL_ENSURE( pCell,
"RemoveFromFormulaTree: pCell Null" );
309 OSL_FAIL(
"RemoveFromFormulaTree: nFormulaCodeInTree < nRPN" );
315 OSL_FAIL(
"!pFormulaTree && nFormulaCodeInTree != 0" );
347 ::std::vector<ScFormulaCell*> vAlwaysDirty;
358 vAlwaysDirty.push_back( pCell);
360 else if ( bSetAllDirty )
367 for (
const auto& rpCell : vAlwaysDirty)
405 pLastNoGood =
nullptr;
412 pCell = pLastNoGood->
GetNext();
416 while ( pCell && !pCell->
GetDirty() )
452 OSL_ENSURE( pCell,
"AppendToFormulaTrack: pCell Null" );
468 OSL_ENSURE( pCell,
"RemoveFromFormulaTrack: pCell Null" );
532 (nHintId == SfxHintId::ScDataChanged || nHintId == SfxHintId::ScHiddenRowsChanged))
551 pBASM->AreaBroadcast( aHint );
558 bool bHaveForced =
false;
584 for (
SCTAB i = 0; i < static_cast<SCTAB>(
maTabs.size()); ++
i )
586 maTabs[i]->StartListeners(aCxt,
true);
594 if ( eUpdateRefMode ==
URM_INSDEL && (nDx > 0 || nDy > 0 || nDz > 0) )
597 pBASM->UpdateBroadcastAreas( eUpdateRefMode, rRange, nDx, nDy, nDz );
bool IsInFormulaTree(const ScFormulaCell *pCell) const
void EnableIdle(bool bDo)
ScFormulaCell * pFormulaTree
#define BCA_LISTEN_ALWAYS
void SetForcedFormulas(bool bVal)
bool IsInInterpreter() const
ScTable * FetchTable(SCTAB nTab)
void purgeEmptyBroadcasters()
void StartListening(const ScAddress &rAddress, SvtListener *pListener)
bool IsExpandRefs() const
sal_uInt16 nFormulaTrackCount
SvtBroadcaster * GetBroadcaster(const ScAddress &rPos)
HardRecalcState eHardRecalcState
void AppendToFormulaTrack(ScFormulaCell *pCell)
ScFormulaCell * pEOFormulaTrack
const ScAddress & GetAddress() const
void RemoveFromFormulaTrack(ScFormulaCell *pCell)
bool HasAnySheetEventScript(ScSheetEventId nEvent, bool bWithVbaEvents=false) const
void SetStreamValid(bool bSet, bool bIgnoreLock=false)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
SC_DLLPUBLIC SCTAB GetTableCount() const
void EndListening(const ScAddress &rAddress, SvtListener *pListener)
ScFormulaCell * pEOFormulaTree
void SetExpandRefs(bool bVal)
std::unique_ptr< ScBroadcastAreaSlotMachine > pBASM
bool IsFinalTrackFormulas() const
bool IsAutoCalcShellDisabled() const
void EndListeningArea(const ScRange &rRange, bool bGroupListening, SvtListener *pListener)
void EndListeningFormulaCells(std::vector< ScFormulaCell * > &rCells)
void PrepareFormulaCalc()
Call this before any operations that might trigger one or more formula cells to get calculated...
ScBroadcastAreaSlotMachine * GetBASM() const
bool mbTrackFormulasPending
void FinalTrackFormulas(SfxHintId nHintId)
bool mbFinalTrackFormulas
void PutInFormulaTree(ScFormulaCell *pCell)
void StartListeningCell(const ScAddress &rAddress, SvtListener *pListener)
A pretty assertion that checks that the relevant bits in the are not set on the document at entry an...
void UpdateBroadcastAreas(UpdateRefMode eUpdateRefMode, const ScRange &rRange, SCCOL nDx, SCROW nDy, SCTAB nDz)
SC_DLLPUBLIC void CalcFormulaTree(bool bOnlyForced=false, bool bProgressBar=true, bool bSetAllDirty=true)
Calculate formula cells that are on the formula tree either partially, or in full.
void Broadcast(const SfxHint &rHint)
void DelBroadcastAreasInRange(const ScRange &rRange)
std::shared_ptr< sc::FormulaGroupContext > mpFormulaGroupCxt
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
void EndListeningCell(const ScAddress &rAddress, SvtListener *pListener)
#define BCA_BRDCST_ALWAYS
void TrackFormulas(SfxHintId nHintId=SfxHintId::ScDataChanged)
static void DeleteInterpretProgress()
void BroadcastUno(const SfxHint &rHint)
sal_uLong nFormulaCodeInTree
static void CreateInterpretProgress(ScDocument *pDoc, bool bWait=true)
void Broadcast(const ScHint &rHint)
Broadcast wrapper, calls rHint.GetCell()->Broadcast() and AreaBroadcast() and TrackFormulas() Preferr...
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
bool bCalculatingFormulaTree
void SetCalcNotification(SCTAB nTab)
bool IsCalculatingFormulaTree() const
void SetForcedFormulaPending(bool bNew)
SC_DLLPUBLIC void CalcAll()
bool IsInFormulaTrack(const ScFormulaCell *pCell) const
CalcAll() without broadcast/notify but setting up new listeners.
bool BroadcastBroadcasters(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScHint &rHint)
Broadcast single broadcasters in range, without explicitly setting anything dirty, not doing area broadcasts.
#define SAL_WARN(area, stream)
void SetTrackFormulasPending()
void StartListeningArea(const ScRange &rRange, bool bGroupListening, SvtListener *pListener)
void RemoveFromFormulaTree(ScFormulaCell *pCell)
bool LimitRangeToAvailableSheets(const ScRange &rRange, ScRange &o_rRange, bool &o_bEntirelyOutOfBounds) const
Adjust a range to available sheets.
bool IsIdleEnabled() const
void AreaBroadcast(const ScHint &rHint)
only area, no cell broadcast
bool ValidTab(SCTAB nTab)
ScFormulaCell * pFormulaTrack
SC_DLLPUBLIC bool GetAutoCalc() const