LibreOffice Module sc (master)
1
|
#include <chartlis.hxx>
Public Types | |
typedef std::map< OUString, std::unique_ptr< ScChartListener > > | ListenersType |
typedef std::unordered_set< OUString > | StringSetType |
Public Member Functions | |
ScChartListenerCollection (ScDocument &rDoc) | |
ScChartListenerCollection (const ScChartListenerCollection &) | |
~ScChartListenerCollection () | |
void | StartAllListeners () |
bool | insert (ScChartListener *pListener) |
ScChartListener * | findByName (const OUString &rName) |
const ScChartListener * | findByName (const OUString &rName) const |
bool | hasListeners () const |
void | removeByName (const OUString &rName) |
const ListenersType & | getListeners () const |
ListenersType & | getListeners () |
StringSetType & | getNonOleObjectNames () |
OUString | getUniqueName (std::u16string_view rPrefix) const |
Create a unique name that's not taken by any existing chart listener objects. More... | |
void | ChangeListening (const OUString &rName, const ScRangeListRef &rRangeListRef) |
void | FreeUnused () |
void | FreeUno (const css::uno::Reference< css::chart::XChartDataChangeEventListener > &rListener, const css::uno::Reference< css::chart::XChartData > &rSource) |
void | StartTimer () |
void | UpdateDirtyCharts () |
void | SetDirty () |
void | SetDiffDirty (const ScChartListenerCollection &, bool bSetChartRangeLists) |
void | SetRangeDirty (const ScRange &rRange) |
void | UpdateChartsContainingTab (SCTAB nTab) |
bool | operator== (const ScChartListenerCollection &r) const |
void | StartListeningHiddenRange (const ScRange &rRange, ScChartHiddenRangeListener *pListener) |
Start listening on hide/show change within specified cell range. More... | |
void | EndListeningHiddenRange (ScChartHiddenRangeListener *pListener) |
Remove all ranges associated with passed listener instance from the list of hidden range listeners. More... | |
Private Types | |
enum | UpdateStatus { SC_CLCUPDATE_NONE, SC_CLCUPDATE_RUNNING, SC_CLCUPDATE_MODIFIED } |
Private Member Functions | |
DECL_LINK (TimerHdl, Timer *, void) | |
ScChartListenerCollection & | operator= (const ScChartListenerCollection &)=delete |
void | Init () |
Private Attributes | |
ListenersType | m_Listeners |
enum ScChartListenerCollection::UpdateStatus | meModifiedDuringUpdate |
std::unordered_multimap< ScChartHiddenRangeListener *, ScRange > | maHiddenListeners |
StringSetType | maNonOleObjectNames |
Idle | aIdle |
ScDocument & | rDoc |
Definition at line 123 of file chartlis.hxx.
typedef std::map<OUString, std::unique_ptr<ScChartListener> > ScChartListenerCollection::ListenersType |
Definition at line 126 of file chartlis.hxx.
typedef std::unordered_set<OUString> ScChartListenerCollection::StringSetType |
Definition at line 127 of file chartlis.hxx.
|
private |
Enumerator | |
---|---|
SC_CLCUPDATE_NONE | |
SC_CLCUPDATE_RUNNING | |
SC_CLCUPDATE_MODIFIED |
Definition at line 130 of file chartlis.hxx.
ScChartListenerCollection::ScChartListenerCollection | ( | ScDocument & | rDoc | ) |
Definition at line 355 of file chartlis.cxx.
References Init().
ScChartListenerCollection::ScChartListenerCollection | ( | const ScChartListenerCollection & | rColl | ) |
Definition at line 362 of file chartlis.cxx.
References Init().
ScChartListenerCollection::~ScChartListenerCollection | ( | ) |
Definition at line 370 of file chartlis.cxx.
References m_Listeners.
void ScChartListenerCollection::ChangeListening | ( | const OUString & | rName, |
const ScRangeListRef & | rRangeListRef | ||
) |
Definition at line 430 of file chartlis.cxx.
References ScChartListener::EndListeningTo(), findByName(), insert(), rDoc, ScChartListener::SetRangeList(), and ScChartListener::StartListeningTo().
Referenced by ScChartObj::setFastPropertyValue_NoBroadcast().
void ScChartListenerCollection::EndListeningHiddenRange | ( | ScChartHiddenRangeListener * | pListener | ) |
Remove all ranges associated with passed listener instance from the list of hidden range listeners.
This does not delete the passed listener instance.
Definition at line 623 of file chartlis.cxx.
References maHiddenListeners.
Referenced by ScChart2DataSequence::RefChanged(), ScChart2DataSequence::removeModifyListener(), and ScChart2DataSequence::~ScChart2DataSequence().
ScChartListener * ScChartListenerCollection::findByName | ( | const OUString & | rName | ) |
Definition at line 402 of file chartlis.cxx.
References m_Listeners.
Referenced by ScChartHelper::AddRangesIfProtectedChart(), ChangeListening(), ScChartHelper::CreateProtectedChartListenersAndNotify(), ScXMLExport::ExportShape(), ScChartObj::getFastPropertyValue(), and SetDiffDirty().
const ScChartListener * ScChartListenerCollection::findByName | ( | const OUString & | rName | ) | const |
Definition at line 408 of file chartlis.cxx.
References m_Listeners.
void ScChartListenerCollection::FreeUno | ( | const css::uno::Reference< css::chart::XChartDataChangeEventListener > & | rListener, |
const css::uno::Reference< css::chart::XChartData > & | rSource | ||
) |
Definition at line 474 of file chartlis.cxx.
References ScChartListener::GetUnoListener(), ScChartListener::GetUnoSource(), ScChartListener::IsUno(), m_Listeners, meModifiedDuringUpdate, p, SC_CLCUPDATE_MODIFIED, and SC_CLCUPDATE_RUNNING.
Referenced by ScCellRangesBase::removeChartDataChangeEventListener().
void ScChartListenerCollection::FreeUnused | ( | ) |
Definition at line 447 of file chartlis.cxx.
References ScChartListener::IsUno(), ScChartListener::IsUsed(), m_Listeners, meModifiedDuringUpdate, p, SC_CLCUPDATE_MODIFIED, SC_CLCUPDATE_RUNNING, and ScChartListener::SetUsed().
|
inline |
Definition at line 165 of file chartlis.hxx.
Referenced by ScCellRangesBase::ForceChartListener_Impl().
|
inline |
Definition at line 166 of file chartlis.hxx.
|
inline |
Definition at line 167 of file chartlis.hxx.
OUString ScChartListenerCollection::getUniqueName | ( | std::u16string_view | rPrefix | ) | const |
Create a unique name that's not taken by any existing chart listener objects.
The name consists of a prefix given followed by a number.
Definition at line 419 of file chartlis.cxx.
References m_Listeners.
Referenced by ScCellRangesBase::addChartDataChangeEventListener(), and ScMyOLEFixer::CreateChartListener().
bool ScChartListenerCollection::hasListeners | ( | ) | const |
Definition at line 414 of file chartlis.cxx.
References m_Listeners.
Referenced by ScDocShell::DoRecalc().
Definition at line 348 of file chartlis.cxx.
References aIdle, LINK, Task::SetDebugName(), Timer::SetInvokeHandler(), and Task::SetPriority().
Referenced by ScChartListenerCollection().
bool ScChartListenerCollection::insert | ( | ScChartListener * | pListener | ) |
Definition at line 387 of file chartlis.cxx.
References aName, ScChartListener::GetName(), m_Listeners, meModifiedDuringUpdate, SC_CLCUPDATE_MODIFIED, and SC_CLCUPDATE_RUNNING.
Referenced by ScCellRangesBase::addChartDataChangeEventListener(), ScChartsObj::addNewByName(), ChangeListening(), XclImpChChart::Convert(), ScMyOLEFixer::CreateChartListener(), and ScChartHelper::CreateProtectedChartListenersAndNotify().
|
privatedelete |
bool ScChartListenerCollection::operator== | ( | const ScChartListenerCollection & | r | ) | const |
Definition at line 605 of file chartlis.cxx.
References m_Listeners, and rDoc.
void ScChartListenerCollection::removeByName | ( | const OUString & | rName | ) |
Definition at line 395 of file chartlis.cxx.
References m_Listeners, meModifiedDuringUpdate, SC_CLCUPDATE_MODIFIED, and SC_CLCUPDATE_RUNNING.
Referenced by ScChartsObj::removeByName(), and ScDBDocFunc::RemovePivotTable().
void ScChartListenerCollection::SetDiffDirty | ( | const ScChartListenerCollection & | rCmp, |
bool | bSetChartRangeLists | ||
) |
Definition at line 537 of file chartlis.cxx.
References assert(), findByName(), ScChartListener::GetName(), ScChartListener::GetRangeList(), tools::SvRef< T >::is(), m_Listeners, rDoc, ScDocument::SetChartRangeList(), ScChartListener::SetDirty(), and StartTimer().
void ScChartListenerCollection::SetDirty | ( | ) |
Definition at line 527 of file chartlis.cxx.
References m_Listeners, and StartTimer().
Definition at line 570 of file chartlis.cxx.
References ScChartListener::GetRangeList(), ScRangeList::Intersects(), tools::SvRef< T >::is(), m_Listeners, maHiddenListeners, ScChartListener::SetDirty(), and StartTimer().
Referenced by ScTable::CopyToTable(), ScTable::DBShowRow(), ScTable::DBShowRows(), ScTable::ShowCol(), ScTable::ShowRow(), and ScTable::ShowRows().
void ScChartListenerCollection::StartAllListeners | ( | ) |
Definition at line 379 of file chartlis.cxx.
References m_Listeners.
void ScChartListenerCollection::StartListeningHiddenRange | ( | const ScRange & | rRange, |
ScChartHiddenRangeListener * | pListener | ||
) |
Start listening on hide/show change within specified cell range.
A single listener may listen on multiple ranges when the caller passes the same pointer multiple times with different ranges.
Note that the caller is responsible for managing the life-cycle of the listener instance.
Definition at line 618 of file chartlis.cxx.
References maHiddenListeners.
Referenced by ScChart2DataSequence::addModifyListener(), and ScChart2DataSequence::RefChanged().
void ScChartListenerCollection::StartTimer | ( | ) |
Definition at line 490 of file chartlis.cxx.
References aIdle, and Idle::Start().
Referenced by SetDiffDirty(), SetDirty(), SetRangeDirty(), ScChartListener::SetUpdateQueue(), and ScChartListener::Update().
Definition at line 596 of file chartlis.cxx.
References m_Listeners, ScDocument::MaxCol(), ScDocument::MaxRow(), and rDoc.
void ScChartListenerCollection::UpdateDirtyCharts | ( | ) |
Definition at line 505 of file chartlis.cxx.
References aIdle, Task::IsActive(), ScChartListener::IsDirty(), ScDocument::IsImportingXML(), m_Listeners, meModifiedDuringUpdate, p, rDoc, SC_CLCUPDATE_MODIFIED, SC_CLCUPDATE_NONE, SC_CLCUPDATE_RUNNING, and ScChartListener::Update().
Referenced by ScDocShell::AfterXMLLoading(), and ScDocShell::PrepareSaveGuard::PrepareSaveGuard().
|
private |
Definition at line 141 of file chartlis.hxx.
Referenced by Init(), StartTimer(), and UpdateDirtyCharts().
|
private |
Definition at line 129 of file chartlis.hxx.
Referenced by findByName(), FreeUno(), FreeUnused(), getUniqueName(), hasListeners(), insert(), operator==(), removeByName(), SetDiffDirty(), SetDirty(), SetRangeDirty(), StartAllListeners(), UpdateChartsContainingTab(), UpdateDirtyCharts(), and ~ScChartListenerCollection().
|
private |
Definition at line 137 of file chartlis.hxx.
Referenced by EndListeningHiddenRange(), SetRangeDirty(), and StartListeningHiddenRange().
|
private |
Definition at line 139 of file chartlis.hxx.
|
private |
Referenced by FreeUno(), FreeUnused(), insert(), removeByName(), and UpdateDirtyCharts().
|
private |
Definition at line 142 of file chartlis.hxx.
Referenced by ChangeListening(), operator==(), SetDiffDirty(), UpdateChartsContainingTab(), and UpdateDirtyCharts().