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)
 

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 142 of file bcaslot.hxx.

Constructor & Destructor Documentation

ScBroadcastAreaSlot::ScBroadcastAreaSlot ( ScDocument pDoc,
ScBroadcastAreaSlotMachine pBASM 
)

Definition at line 106 of file bcaslot.cxx.

ScBroadcastAreaSlot::~ScBroadcastAreaSlot ( )

Definition at line 116 of file bcaslot.cxx.

References aBroadcastAreaTbl, and ScBroadcastArea::DecRef().

Member Function Documentation

bool ScBroadcastAreaSlot::AreaBroadcast ( const ScRange rRange,
SfxHintId  nHint 
)
bool ScBroadcastAreaSlot::AreaBroadcast ( const ScHint rHint)
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 132 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().

void ScBroadcastAreaSlot::DelBroadcastAreasInRange ( const ScRange rRange)
void ScBroadcastAreaSlot::EndListeningArea ( const ScRange rRange,
bool  bGroupListening,
SvtListener pListener,
ScBroadcastArea *&  rpArea 
)
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 483 of file bcaslot.cxx.

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

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

void ScBroadcastAreaSlot::FinallyEraseAreas ( )
private

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

Definition at line 606 of file bcaslot.cxx.

References ScBroadcastAreaSlotMachine::FinallyEraseAreas(), and pBASM.

Referenced by AreaBroadcast().

ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea ( const ScRange rRange,
bool  bGroupListening 
)
private
void ScBroadcastAreaSlot::GetAllListeners ( const ScRange rRange,
std::vector< sc::AreaListener > &  rListeners,
sc::AreaOverlapType  eType,
sc::ListenerGroupType  eGroup 
)
void ScBroadcastAreaSlot::InsertListeningArea ( ScBroadcastArea pArea)

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

Definition at line 197 of file bcaslot.cxx.

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

bool ScBroadcastAreaSlot::IsInBroadcastIteration ( ) const
inline

Definition at line 223 of file bcaslot.hxx.

References mbInBroadcastIteration.

Referenced by ScBroadcastAreaSlotMachine::FinallyEraseAreas().

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

Definition at line 175 of file bcaslot.hxx.

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

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 153 of file bcaslot.cxx.

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

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

Member Data Documentation

ScBroadcastAreas ScBroadcastAreaSlot::aBroadcastAreaTbl
private
ScBroadcastArea ScBroadcastAreaSlot::aTmpSeekBroadcastArea
mutableprivate

Definition at line 146 of file bcaslot.hxx.

Referenced by FindBroadcastArea().

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 158 of file bcaslot.hxx.

Referenced by AreaBroadcast(), and EraseArea().

bool ScBroadcastAreaSlot::mbInBroadcastIteration
private

Definition at line 149 of file bcaslot.hxx.

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

ScBroadcastAreaSlotMachine* ScBroadcastAreaSlot::pBASM
private
ScDocument* ScBroadcastAreaSlot::pDoc
private

Definition at line 147 of file bcaslot.hxx.

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


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