#96783# ChartListenerCollection dtor: delete elements before Timer dtor is called

This commit is contained in:
Niklas Nebel 2002-01-22 07:26:43 +00:00
parent af99b7da7e
commit a3d300c52a
2 changed files with 16 additions and 4 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: chartlis.hxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: er $ $Date: 2000-12-13 12:37:08 $
* last change: $Author: nn $ $Date: 2002-01-22 08:25:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -157,6 +157,8 @@ public:
ScChartListenerCollection( const ScChartListenerCollection& );
virtual DataObject* Clone() const;
virtual ~ScChartListenerCollection();
// nur nach copy-ctor noetig, wenn neu ins Dok gehaengt
void StartAllListeners();

View file

@ -2,9 +2,9 @@
*
* $RCSfile: chartlis.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: nn $ $Date: 2001-07-20 10:03:57 $
* last change: $Author: nn $ $Date: 2002-01-22 08:26:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -307,6 +307,16 @@ ScChartListenerCollection::ScChartListenerCollection(
aTimer.SetTimeoutHdl( LINK( this, ScChartListenerCollection, TimerHdl ) );
}
ScChartListenerCollection::~ScChartListenerCollection()
{
// #96783# remove ChartListener objects before aTimer dtor is called, because
// ScChartListener::EndListeningTo may cause ScChartListenerCollection::StartTimer
// to be called if an empty ScNoteCell is deleted
if (GetCount())
FreeAll();
}
DataObject* ScChartListenerCollection::Clone() const
{
return new ScChartListenerCollection( *this );