LibreOffice Module sc (master) 1
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ScBroadcastAreaSlot Class Reference

Collection of BroadcastAreas. More...

#include <bcaslot.hxx>

Collaboration diagram for ScBroadcastAreaSlot:
[legend]

Public Member Functions

 ScBroadcastAreaSlot (ScDocument *pDoc, ScBroadcastAreaSlotMachine *pBASM)
 
 ~ScBroadcastAreaSlot ()
 
bool StartListeningArea (const ScRange &rRange, bool bGroupListening, SvtListener *pListener, ScBroadcastArea *&rpArea)
 Only here new ScBroadcastArea objects are created, prevention of dupes. More...
 
void InsertListeningArea (ScBroadcastArea *pArea)
 Insert a ScBroadcastArea obtained via StartListeningArea() to subsequent slots. More...
 
void EndListeningArea (const ScRange &rRange, bool bGroupListening, SvtListener *pListener, ScBroadcastArea *&rpArea)
 
bool AreaBroadcast (const ScRange &rRange, SfxHintId nHint)
 
bool AreaBroadcast (const ScHint &rHint)
 
void DelBroadcastAreasInRange (const ScRange &rRange)
 
void UpdateRemove (UpdateRefMode eUpdateRefMode, const ScRange &rRange, SCCOL nDx, SCROW nDy, SCTAB nDz)
 
void UpdateRemoveArea (ScBroadcastArea *pArea)
 
void UpdateInsert (ScBroadcastArea *pArea)
 
bool IsInBroadcastIteration () const
 
void EraseArea (ScBroadcastAreas::iterator &rIter)
 Erase an area from set and delete it if last reference, or if mbInBroadcastIteration is set push it to the vector of to-be-erased areas instead. More...
 
void GetAllListeners (const ScRange &rRange, std::vector< sc::AreaListener > &rListeners, sc::AreaOverlapType eType, sc::ListenerGroupType eGroup)
 
void CollectBroadcasterState (sc::BroadcasterState &rState) const
 

Private Member Functions

ScBroadcastAreas::iterator FindBroadcastArea (const ScRange &rRange, bool bGroupListening)
 
ScDocument::HardRecalcState CheckHardRecalcStateCondition () const
 More hypothetical (memory would probably be doomed anyway) check whether there would be an overflow when adding an area, setting the proper state if so. More...
 
void FinallyEraseAreas ()
 Finally erase all areas pushed as to-be-erased. More...
 

Static Private Member Functions

static bool isMarkedErased (const ScBroadcastAreas::const_iterator &rIter)
 

Private Attributes

ScBroadcastAreas aBroadcastAreaTbl
 
ScBroadcastArea aTmpSeekBroadcastArea
 
ScDocumentpDoc
 
ScBroadcastAreaSlotMachinepBASM
 
bool mbInBroadcastIteration
 
bool mbHasErasedArea
 If true, the slot has at least one area broadcaster marked for removal. More...
 

Detailed Description

Collection of BroadcastAreas.

Definition at line 146 of file bcaslot.hxx.

Constructor & Destructor Documentation

◆ ScBroadcastAreaSlot()

ScBroadcastAreaSlot::ScBroadcastAreaSlot ( ScDocument pDoc,
ScBroadcastAreaSlotMachine pBASM 
)

Definition at line 43 of file bcaslot.cxx.

◆ ~ScBroadcastAreaSlot()

ScBroadcastAreaSlot::~ScBroadcastAreaSlot ( )

Definition at line 53 of file bcaslot.cxx.

References aBroadcastAreaTbl, and ScBroadcastArea::DecRef().

Member Function Documentation

◆ AreaBroadcast() [1/2]

bool ScBroadcastAreaSlot::AreaBroadcast ( const ScHint rHint)

◆ AreaBroadcast() [2/2]

bool ScBroadcastAreaSlot::AreaBroadcast ( const ScRange rRange,
SfxHintId  nHint 
)

◆ CheckHardRecalcStateCondition()

ScDocument::HardRecalcState ScBroadcastAreaSlot::CheckHardRecalcStateCondition ( ) const
private

More hypothetical (memory would probably be doomed anyway) check whether there would be an overflow when adding an area, setting the proper state if so.

Returns
HardRecalcState::ETERNAL if a HardRecalcState is effective and area is not to be added.

Definition at line 69 of file bcaslot.cxx.

References aBroadcastAreaTbl, ScDocument::ETERNAL, ScDocument::GetDocumentShell(), ScDocument::GetHardRecalcState(), ScDocument::OFF, pDoc, SCWARN_CORE_HARD_RECALC, ScDocument::SetAutoCalc(), SfxObjectShell::SetError(), and ScDocument::SetHardRecalcState().

Referenced by InsertListeningArea(), and StartListeningArea().

◆ CollectBroadcasterState()

void ScBroadcastAreaSlot::CollectBroadcasterState ( sc::BroadcasterState rState) const

◆ DelBroadcastAreasInRange()

void ScBroadcastAreaSlot::DelBroadcastAreasInRange ( const ScRange rRange)

◆ EndListeningArea()

void ScBroadcastAreaSlot::EndListeningArea ( const ScRange rRange,
bool  bGroupListening,
SvtListener pListener,
ScBroadcastArea *&  rpArea 
)

◆ EraseArea()

void ScBroadcastAreaSlot::EraseArea ( ScBroadcastAreas::iterator &  rIter)

Erase an area from set and delete it if last reference, or if mbInBroadcastIteration is set push it to the vector of to-be-erased areas instead.

Meant to be used internally and from ScBroadcastAreaSlotMachine only.

Definition at line 419 of file bcaslot.cxx.

References aBroadcastAreaTbl, ScBroadcastArea::DecRef(), ScBroadcastAreaSlotMachine::IsInBulkBroadcast(), mbHasErasedArea, mbInBroadcastIteration, pBASM, ScBroadcastAreaSlotMachine::PushAreaToBeErased(), and ScBroadcastAreaSlotMachine::RemoveBulkGroupArea().

Referenced by EndListeningArea(), and ScBroadcastAreaSlotMachine::FinallyEraseAreas().

◆ FinallyEraseAreas()

void ScBroadcastAreaSlot::FinallyEraseAreas ( )
private

Finally erase all areas pushed as to-be-erased.

Definition at line 528 of file bcaslot.cxx.

References ScBroadcastAreaSlotMachine::FinallyEraseAreas(), and pBASM.

Referenced by AreaBroadcast().

◆ FindBroadcastArea()

ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea ( const ScRange rRange,
bool  bGroupListening 
)
private

◆ GetAllListeners()

void ScBroadcastAreaSlot::GetAllListeners ( const ScRange rRange,
std::vector< sc::AreaListener > &  rListeners,
sc::AreaOverlapType  eType,
sc::ListenerGroupType  eGroup 
)

◆ InsertListeningArea()

void ScBroadcastAreaSlot::InsertListeningArea ( ScBroadcastArea pArea)

Insert a ScBroadcastArea obtained via StartListeningArea() to subsequent slots.

Definition at line 134 of file bcaslot.cxx.

References aBroadcastAreaTbl, CheckHardRecalcStateCondition(), ScDocument::ETERNAL, and ScBroadcastArea::IncRef().

◆ IsInBroadcastIteration()

bool ScBroadcastAreaSlot::IsInBroadcastIteration ( ) const
inline

Definition at line 227 of file bcaslot.hxx.

References mbInBroadcastIteration.

Referenced by ScBroadcastAreaSlotMachine::FinallyEraseAreas().

◆ isMarkedErased()

static bool ScBroadcastAreaSlot::isMarkedErased ( const ScBroadcastAreas::const_iterator &  rIter)
inlinestaticprivate

Definition at line 179 of file bcaslot.hxx.

Referenced by AreaBroadcast(), EndListeningArea(), and GetAllListeners().

◆ StartListeningArea()

bool ScBroadcastAreaSlot::StartListeningArea ( const ScRange rRange,
bool  bGroupListening,
SvtListener pListener,
ScBroadcastArea *&  rpArea 
)

Only here new ScBroadcastArea objects are created, prevention of dupes.

Parameters
rpAreaIf NULL, a new ScBroadcastArea is created and assigned ton the reference if a matching area wasn't found. If a matching area was found, that is assigned. In any case, the SvtListener is added to the broadcaster.

If not NULL then no listeners are started, only the area is inserted and the reference count incremented. Effectively the same as InsertListeningArea(), so use that instead.

Returns
true if rpArea passed was NULL and ScBroadcastArea is newly created.

Definition at line 90 of file bcaslot.cxx.

References aBroadcastAreaTbl, CheckHardRecalcStateCondition(), ScDocument::ETERNAL, FindBroadcastArea(), ScBroadcastArea::GetBroadcaster(), ScBroadcastArea::IncRef(), ScDocument::IsDelayedFormulaGrouping(), pDoc, ScBroadcastArea::SetGroupListening(), and SvtListener::StartListening().

◆ UpdateInsert()

void ScBroadcastAreaSlot::UpdateInsert ( ScBroadcastArea pArea)

◆ UpdateRemove()

void ScBroadcastAreaSlot::UpdateRemove ( UpdateRefMode  eUpdateRefMode,
const ScRange rRange,
SCCOL  nDx,
SCROW  nDy,
SCTAB  nDz 
)

◆ UpdateRemoveArea()

void ScBroadcastAreaSlot::UpdateRemoveArea ( ScBroadcastArea pArea)

Member Data Documentation

◆ aBroadcastAreaTbl

ScBroadcastAreas ScBroadcastAreaSlot::aBroadcastAreaTbl
private

◆ aTmpSeekBroadcastArea

ScBroadcastArea ScBroadcastAreaSlot::aTmpSeekBroadcastArea
mutableprivate

Definition at line 150 of file bcaslot.hxx.

Referenced by FindBroadcastArea().

◆ mbHasErasedArea

bool ScBroadcastAreaSlot::mbHasErasedArea
private

If true, the slot has at least one area broadcaster marked for removal.

This flag is used only during broadcast iteration, to speed up iteration. Using this flag is cheaper than dereferencing each iterator and checking its own flag inside especially when no areas are marked for removal.

Definition at line 162 of file bcaslot.hxx.

Referenced by AreaBroadcast(), and EraseArea().

◆ mbInBroadcastIteration

bool ScBroadcastAreaSlot::mbInBroadcastIteration
private

Definition at line 153 of file bcaslot.hxx.

Referenced by AreaBroadcast(), EraseArea(), and IsInBroadcastIteration().

◆ pBASM

ScBroadcastAreaSlotMachine* ScBroadcastAreaSlot::pBASM
private

◆ pDoc

ScDocument* ScBroadcastAreaSlot::pDoc
private

Definition at line 151 of file bcaslot.hxx.

Referenced by CheckHardRecalcStateCondition(), StartListeningArea(), and UpdateRemove().


The documentation for this class was generated from the following files: