Tag: cws_dev300_dba30c User: oj Date: 2008-05-05 06:16:48+0000 Modified: dba/dbaccess/source/core/dataaccess/ComponentDefinition.cxx dba/dbaccess/source/core/dataaccess/ComponentDefinition.hxx
Log: #156608# clear listener after disposing columns File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: ComponentDefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ComponentDefinition.cxx?r1=1.15&r2=1.15.8.1 Delta lines: +9 -6 ------------------- --- ComponentDefinition.cxx 2008-04-10 12:36:46+0000 1.15 +++ ComponentDefinition.cxx 2008-05-05 06:16:45+0000 1.15.8.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ComponentDefinition.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.15.8.1 $ * * This file is part of OpenOffice.org. * @@ -97,12 +97,14 @@ // XPropertyChangeListener virtual void SAL_CALL propertyChange( const PropertyChangeEvent& /*_rEvent*/ ) throw (RuntimeException) { + if ( m_pComponent ) m_pComponent->notifyDataSourceModified(); } // XEventListener virtual void SAL_CALL disposing( const EventObject& /*_rSource*/ ) throw (RuntimeException) { } + void clear() { m_pComponent = NULL; } }; DBG_NAME(OComponentDefinition_Impl) OComponentDefinition_Impl::OComponentDefinition_Impl() @@ -122,7 +124,7 @@ //-------------------------------------------------------------------------- void OComponentDefinition::registerProperties() { - m_xColumnPropertyListener = new OColumnPropertyListener(this); + m_xColumnPropertyListener = ::comphelper::ImplementationReference<OColumnPropertyListener,XPropertyChangeListener>(new OColumnPropertyListener(this)); OComponentDefinition_Impl& rDefinition( getDefinition() ); ODataSettings::registerPropertiesFor( &rDefinition ); @@ -215,9 +217,10 @@ void SAL_CALL OComponentDefinition::disposing() { OContentHelper::disposing(); - m_xColumnPropertyListener.clear(); if ( m_pColumns.get() ) m_pColumns->disposing(); + m_xColumnPropertyListener->clear(); + m_xColumnPropertyListener.dispose(); } // ----------------------------------------------------------------------------- IPropertyArrayHelper& OComponentDefinition::getInfoHelper() @@ -267,7 +270,7 @@ OComponentDefinition_Impl::const_iterator aFind = rDefinition.find( _rName ); if ( aFind != rDefinition.end() ) { - aFind->second->addPropertyChangeListener(::rtl::OUString(),m_xColumnPropertyListener); + aFind->second->addPropertyChangeListener(::rtl::OUString(),m_xColumnPropertyListener.getRef()); return new OTableColumnWrapper( aFind->second, aFind->second, sal_True ); } return new OTableColumn( _rName ); File [changed]: ComponentDefinition.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ComponentDefinition.hxx?r1=1.11&r2=1.11.8.1 Delta lines: +5 -4 ------------------- --- ComponentDefinition.hxx 2008-04-10 12:37:07+0000 1.11 +++ ComponentDefinition.hxx 2008-05-05 06:16:45+0000 1.11.8.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ComponentDefinition.hxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.8.1 $ * * This file is part of OpenOffice.org. * @@ -70,6 +70,7 @@ #ifndef _DBA_COREAPI_COLUMN_HXX_ #include <column.hxx> #endif +#include <comphelper/implementationreference.hxx> #include <memory> //........................................................................ @@ -116,7 +117,7 @@ } }; - +class OColumnPropertyListener; //========================================================================= //= OComponentDefinition - a database "document" which describes a query //========================================================================= @@ -130,7 +131,7 @@ protected: ::std::auto_ptr< OColumns > m_pColumns; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener> + ::comphelper::ImplementationReference< OColumnPropertyListener,::com::sun::star::beans::XPropertyChangeListener> m_xColumnPropertyListener; sal_Bool m_bTable; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
