LibreOffice Module sc (master) 1
|
Collection of BroadcastAreas. More...
#include <bcaslot.hxx>
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 |
ScDocument * | pDoc |
ScBroadcastAreaSlotMachine * | pBASM |
bool | mbInBroadcastIteration |
bool | mbHasErasedArea |
If true, the slot has at least one area broadcaster marked for removal. More... | |
Collection of BroadcastAreas.
Definition at line 146 of file bcaslot.hxx.
ScBroadcastAreaSlot::ScBroadcastAreaSlot | ( | ScDocument * | pDoc, |
ScBroadcastAreaSlotMachine * | pBASM | ||
) |
Definition at line 43 of file bcaslot.cxx.
ScBroadcastAreaSlot::~ScBroadcastAreaSlot | ( | ) |
Definition at line 53 of file bcaslot.cxx.
References aBroadcastAreaTbl, and ScBroadcastArea::DecRef().
bool ScBroadcastAreaSlot::AreaBroadcast | ( | const ScHint & | rHint | ) |
Definition at line 262 of file bcaslot.cxx.
References aBroadcastAreaTbl, SvtBroadcaster::Broadcast(), FinallyEraseAreas(), ScBroadcastArea::GetBroadcaster(), ScHint::GetRange(), ScBroadcastArea::GetRange(), ScBroadcastAreaSlotMachine::InsertBulkArea(), ScBroadcastAreaSlotMachine::InsertBulkGroupArea(), ScRange::Intersects(), ScBroadcastArea::IsGroupListening(), ScBroadcastAreaSlotMachine::IsInBulkBroadcast(), isMarkedErased(), mbHasErasedArea, mbInBroadcastIteration, and pBASM.
Definition at line 208 of file bcaslot.cxx.
References aBroadcastAreaTbl, FinallyEraseAreas(), ScBroadcastArea::GetBroadcaster(), ScBroadcastArea::GetRange(), ScBroadcastAreaSlotMachine::InsertBulkArea(), ScBroadcastAreaSlotMachine::InsertBulkGroupArea(), ScRange::Intersection(), ScBroadcastArea::IsGroupListening(), ScBroadcastAreaSlotMachine::IsInBulkBroadcast(), isMarkedErased(), ScRange::IsValid(), mbHasErasedArea, mbInBroadcastIteration, and pBASM.
Referenced by ScBroadcastAreaSlotMachine::AreaBroadcast().
|
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.
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().
void ScBroadcastAreaSlot::CollectBroadcasterState | ( | sc::BroadcasterState & | rState | ) | const |
Definition at line 501 of file bcaslot.cxx.
References sc::BroadcasterState::aAreaListenerStore, and aBroadcastAreaTbl.
Referenced by ScBroadcastAreaSlotMachine::CollectBroadcasterState().
void ScBroadcastAreaSlot::DelBroadcastAreasInRange | ( | const ScRange & | rRange | ) |
Definition at line 314 of file bcaslot.cxx.
References aBroadcastAreaTbl, ScRange::Contains(), ScBroadcastArea::DecRef(), ScBroadcastAreaSlotMachine::IsInBulkBroadcast(), pBASM, and ScBroadcastAreaSlotMachine::RemoveBulkArea().
Referenced by ScBroadcastAreaSlotMachine::DelBroadcastAreasInRange().
void ScBroadcastAreaSlot::EndListeningArea | ( | const ScRange & | rRange, |
bool | bGroupListening, | ||
SvtListener * | pListener, | ||
ScBroadcastArea *& | rpArea | ||
) |
Definition at line 145 of file bcaslot.cxx.
References aBroadcastAreaTbl, SvtListener::EndListening(), EraseArea(), FindBroadcastArea(), ScBroadcastArea::GetBroadcaster(), ScBroadcastArea::GetRef(), SvtBroadcaster::HasListeners(), and isMarkedErased().
Referenced by ScBroadcastAreaSlotMachine::EndListeningArea().
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().
|
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().
|
private |
Definition at line 178 of file bcaslot.cxx.
References aBroadcastAreaTbl, aTmpSeekBroadcastArea, ScBroadcastArea::SetGroupListening(), and ScBroadcastArea::UpdateRange().
Referenced by EndListeningArea(), and StartListeningArea().
void ScBroadcastAreaSlot::GetAllListeners | ( | const ScRange & | rRange, |
std::vector< sc::AreaListener > & | rListeners, | ||
sc::AreaOverlapType | eType, | ||
sc::ListenerGroupType | eGroup | ||
) |
Definition at line 440 of file bcaslot.cxx.
References aBroadcastAreaTbl, ScRange::aEnd, ScRange::aStart, sc::Both, ScAddress::Col(), ScRange::Contains(), eType, SvtBroadcaster::GetAllListeners(), ScBroadcastArea::GetBroadcaster(), ScBroadcastArea::GetRange(), sc::Group, sc::Inside, sc::InsideOrOverlap, ScRange::Intersects(), ScBroadcastArea::IsGroupListening(), isMarkedErased(), sc::AreaListener::maArea, sc::AreaListener::mbGroupListening, sc::AreaListener::mpListener, sc::OneColumnInside, sc::OneRowInside, and ScAddress::Row().
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().
|
inline |
Definition at line 227 of file bcaslot.hxx.
References mbInBroadcastIteration.
Referenced by ScBroadcastAreaSlotMachine::FinallyEraseAreas().
|
inlinestaticprivate |
Definition at line 179 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.
rpArea | If 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.
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().
void ScBroadcastAreaSlot::UpdateInsert | ( | ScBroadcastArea * | pArea | ) |
Definition at line 396 of file bcaslot.cxx.
References aBroadcastAreaTbl, SvtBroadcaster::GetAllListeners(), ScBroadcastArea::GetBroadcaster(), ScBroadcastArea::IncRef(), rTarget, and SvtListener::StartListening().
void ScBroadcastAreaSlot::UpdateRemove | ( | UpdateRefMode | eUpdateRefMode, |
const ScRange & | rRange, | ||
SCCOL | nDx, | ||
SCROW | nDy, | ||
SCTAB | nDz | ||
) |
Definition at line 338 of file bcaslot.cxx.
References aBroadcastAreaTbl, ScBroadcastArea::DecRef(), ScBroadcastAreaSlotMachine::GetEOUpdateChain(), ScBroadcastArea::GetRange(), ScRange::GetVars(), ScBroadcastAreaSlotMachine::IsInBulkBroadcast(), ScBroadcastArea::IsInUpdateChain(), pBASM, pDoc, ScBroadcastAreaSlotMachine::RemoveBulkArea(), ScBroadcastAreaSlotMachine::SetEOUpdateChain(), ScBroadcastArea::SetInUpdateChain(), ScBroadcastAreaSlotMachine::SetUpdateChain(), ScBroadcastArea::SetUpdateChainNext(), and ScRefUpdate::Update().
Referenced by ScBroadcastAreaSlotMachine::UpdateBroadcastAreas().
void ScBroadcastAreaSlot::UpdateRemoveArea | ( | ScBroadcastArea * | pArea | ) |
Definition at line 382 of file bcaslot.cxx.
References aBroadcastAreaTbl, and ScBroadcastArea::DecRef().
Referenced by ScBroadcastAreaSlotMachine::UpdateBroadcastAreas().
|
private |
Definition at line 149 of file bcaslot.hxx.
Referenced by AreaBroadcast(), CheckHardRecalcStateCondition(), CollectBroadcasterState(), DelBroadcastAreasInRange(), EndListeningArea(), EraseArea(), FindBroadcastArea(), GetAllListeners(), InsertListeningArea(), StartListeningArea(), UpdateInsert(), UpdateRemove(), UpdateRemoveArea(), and ~ScBroadcastAreaSlot().
|
mutableprivate |
Definition at line 150 of file bcaslot.hxx.
Referenced by FindBroadcastArea().
|
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().
|
private |
Definition at line 153 of file bcaslot.hxx.
Referenced by AreaBroadcast(), EraseArea(), and IsInBroadcastIteration().
|
private |
Definition at line 152 of file bcaslot.hxx.
Referenced by AreaBroadcast(), DelBroadcastAreasInRange(), EraseArea(), FinallyEraseAreas(), and UpdateRemove().
|
private |
Definition at line 151 of file bcaslot.hxx.
Referenced by CheckHardRecalcStateCondition(), StartListeningArea(), and UpdateRemove().