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_DLLPRIVATE_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 122 of file chartlis.hxx.
typedef std::map<OUString, std::unique_ptr<ScChartListener> > ScChartListenerCollection::ListenersType |
Definition at line 125 of file chartlis.hxx.
typedef std::unordered_set<OUString> ScChartListenerCollection::StringSetType |
Definition at line 126 of file chartlis.hxx.
|
private |
Enumerator | |
---|---|
SC_CLCUPDATE_NONE | |
SC_CLCUPDATE_RUNNING | |
SC_CLCUPDATE_MODIFIED |
Definition at line 129 of file chartlis.hxx.
ScChartListenerCollection::ScChartListenerCollection | ( | ScDocument & | rDoc | ) |
Definition at line 354 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 371 of file chartlis.cxx.
References m_Listeners.
void ScChartListenerCollection::ChangeListening | ( | const OUString & | rName, |
const ScRangeListRef & | rRangeListRef | ||
) |
Definition at line 431 of file chartlis.cxx.
References ScChartListener::EndListeningTo(), findByName(), insert(), rDoc, ScChartListener::SetRangeList(), and ScChartListener::StartListeningTo().
Referenced by ScChartObj::setFastPropertyValue_NoBroadcast().
|
private |
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 624 of file chartlis.cxx.
References maHiddenListeners.
Referenced by ScChart2DataSequence::RefChanged(), ScChart2DataSequence::removeModifyListener(), and ScChart2DataSequence::~ScChart2DataSequence().
ScChartListener * ScChartListenerCollection::findByName | ( | const OUString & | rName | ) |
Definition at line 403 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 409 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 475 of file chartlis.cxx.
References m_Listeners, meModifiedDuringUpdate, p, SC_CLCUPDATE_MODIFIED, and SC_CLCUPDATE_RUNNING.
void ScChartListenerCollection::FreeUnused | ( | ) |
Definition at line 448 of file chartlis.cxx.
References m_Listeners, meModifiedDuringUpdate, p, SC_CLCUPDATE_MODIFIED, and SC_CLCUPDATE_RUNNING.
|
inline |
Definition at line 165 of file chartlis.hxx.
|
inline |
Definition at line 164 of file chartlis.hxx.
|
inline |
Definition at line 166 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 420 of file chartlis.cxx.
References m_Listeners.
Referenced by ScMyOLEFixer::CreateChartListener().
bool ScChartListenerCollection::hasListeners | ( | ) | const |
Definition at line 415 of file chartlis.cxx.
References m_Listeners.
Referenced by ScDocShell::DoRecalc().
|
private |
Definition at line 348 of file chartlis.cxx.
References aIdle, LINK, Timer::SetInvokeHandler(), and Task::SetPriority().
Referenced by ScChartListenerCollection().
bool ScChartListenerCollection::insert | ( | ScChartListener * | pListener | ) |
Definition at line 388 of file chartlis.cxx.
References aName, ScChartListener::GetName(), m_Listeners, meModifiedDuringUpdate, SC_CLCUPDATE_MODIFIED, and SC_CLCUPDATE_RUNNING.
Referenced by ScChartsObj::addNewByName(), ChangeListening(), XclImpChChart::Convert(), ScMyOLEFixer::CreateChartListener(), and ScChartHelper::CreateProtectedChartListenersAndNotify().
|
privatedelete |
References Init().
bool ScChartListenerCollection::operator== | ( | const ScChartListenerCollection & | r | ) | const |
Definition at line 606 of file chartlis.cxx.
References m_Listeners, and rDoc.
void ScChartListenerCollection::removeByName | ( | const OUString & | rName | ) |
Definition at line 396 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 538 of file chartlis.cxx.
References findByName(), ScChartListener::GetName(), ScChartListener::GetRangeList(), tools::SvRef< typename T >::is(), m_Listeners, rDoc, ScDocument::SetChartRangeList(), ScChartListener::SetDirty(), and StartTimer().
void ScChartListenerCollection::SetDirty | ( | ) |
Definition at line 528 of file chartlis.cxx.
References m_Listeners, and StartTimer().
void ScChartListenerCollection::SetRangeDirty | ( | const ScRange & | rRange | ) |
Definition at line 571 of file chartlis.cxx.
References ScChartListener::GetRangeList(), tools::SvRef< typename 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 380 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 619 of file chartlis.cxx.
References maHiddenListeners.
Referenced by ScChart2DataSequence::addModifyListener(), and ScChart2DataSequence::RefChanged().
void ScChartListenerCollection::StartTimer | ( | ) |
Definition at line 491 of file chartlis.cxx.
References aIdle, and Idle::Start().
Referenced by SetDiffDirty(), SetDirty(), SetRangeDirty(), ScChartListener::SetUpdateQueue(), and ScChartListener::Update().
void ScChartListenerCollection::UpdateChartsContainingTab | ( | SCTAB | nTab | ) |
Definition at line 597 of file chartlis.cxx.
References m_Listeners, ScDocument::MaxCol(), ScDocument::MaxRow(), and rDoc.
void ScChartListenerCollection::UpdateDirtyCharts | ( | ) |
Definition at line 506 of file chartlis.cxx.
References aIdle, Task::IsActive(), ScDocument::IsImportingXML(), m_Listeners, meModifiedDuringUpdate, p, rDoc, SC_CLCUPDATE_MODIFIED, SC_CLCUPDATE_NONE, and SC_CLCUPDATE_RUNNING.
Referenced by ScDocShell::AfterXMLLoading(), and ScDocShell::PrepareSaveGuard::PrepareSaveGuard().
|
private |
Definition at line 140 of file chartlis.hxx.
Referenced by Init(), StartTimer(), and UpdateDirtyCharts().
|
private |
Definition at line 128 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 136 of file chartlis.hxx.
Referenced by EndListeningHiddenRange(), SetRangeDirty(), and StartListeningHiddenRange().
|
private |
Definition at line 138 of file chartlis.hxx.
|
private |
Referenced by FreeUno(), FreeUnused(), insert(), removeByName(), and UpdateDirtyCharts().
|
private |
Definition at line 141 of file chartlis.hxx.
Referenced by ChangeListening(), operator==(), SetDiffDirty(), UpdateChartsContainingTab(), and UpdateDirtyCharts().