diff -Naur chart2.31m11/chart2/source/model/inc/DataSeries.hxx chart2.fix/chart2/source/model/inc/DataSeries.hxx --- chart2.31m11/chart2/source/model/inc/DataSeries.hxx 2008-04-11 05:31:20.000000000 +0800 +++ chart2.fix/chart2/source/model/inc/DataSeries.hxx 2010-08-10 09:56:39.503544100 +0800 @@ -42,10 +42,11 @@ #include #include #include +#include // helper classes #include "ServiceMacros.hxx" -#include +#include #include #include @@ -65,7 +66,7 @@ namespace impl { -typedef ::cppu::WeakImplHelper8< +typedef ::cppu::WeakImplHelper9< ::com::sun::star::chart2::XDataSeries, ::com::sun::star::chart2::data::XDataSink, ::com::sun::star::chart2::data::XDataSource, @@ -73,7 +74,8 @@ ::com::sun::star::chart2::XRegressionCurveContainer, ::com::sun::star::util::XCloneable, ::com::sun::star::util::XModifyBroadcaster, - ::com::sun::star::util::XModifyListener > + ::com::sun::star::util::XModifyListener, + ::com::sun::star::lang::XComponent > DataSeries_Base; } @@ -201,6 +203,15 @@ */ ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const; + // ____ XComponent ____ + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener >& aListener ) + throw (::com::sun::star::uno::RuntimeException); private: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > diff -Naur chart2.31m11/chart2/source/model/main/DataSeries.cxx chart2.fix/chart2/source/model/main/DataSeries.cxx --- chart2.31m11/chart2/source/model/main/DataSeries.cxx 2008-04-11 05:38:23.000000000 +0800 +++ chart2.fix/chart2/source/model/main/DataSeries.cxx 2010-08-10 10:20:19.070452700 +0800 @@ -555,6 +555,26 @@ m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this ))); } +// ____ XComponent ____ +void SAL_CALL DataSeries::dispose() + throw (::com::sun::star::uno::RuntimeException) +{ + ModifyListenerHelper::removeListenerFromAllMapElements( m_aAttributedDataPoints, m_xModifyEventForwarder ); + m_aAttributedDataPoints.clear(); +} + +void SAL_CALL DataSeries::addEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException) +{ +} + +void SAL_CALL DataSeries::removeEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener >& aListener ) + throw (::com::sun::star::uno::RuntimeException) +{ +} + // ================================================================================ diff -Naur chart2.31m11/chart2/source/model/template/ChartType.cxx chart2.fix/chart2/source/model/template/ChartType.cxx --- chart2.31m11/chart2/source/model/template/ChartType.cxx 2008-04-11 05:50:48.000000000 +0800 +++ chart2.fix/chart2/source/model/template/ChartType.cxx 2010-08-10 10:41:03.306302400 +0800 @@ -77,6 +77,12 @@ ChartType::~ChartType() { ModifyListenerHelper::removeListenerFromAllElements( m_aDataSeries, m_xModifyEventForwarder ); + + for( sal_Int32 i=0; i xComp( m_aDataSeries[i], uno::UNO_QUERY ); + if( xComp.is()) + xComp->dispose(); + } m_aDataSeries.clear(); }