diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-07 11:44:41 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-12 23:25:08 +0200 |
commit | a06d710466ca4fd433a93a297a7a27af8a2746b3 (patch) | |
tree | b268b28aa2b1fa12e0562137d5b47ea2db2f023a /sc/source | |
parent | 509e87d05379f7bd7ecf842e7114ccaa9a3d6020 (diff) |
Convert SV_DECL_PTR_ARR_DEL(XDBRefreshListenerArr_Impl) to ptr_vector
Change-Id: I2fee4cf49ff48e4cffef0bcba704b69aad8242d8
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index f695bf8257db..f40135f46047 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -66,8 +66,6 @@ using namespace com::sun::star; -SV_IMPL_PTRARR( XDBRefreshListenerArr_Impl, XDBRefreshListenerPtr ); - //------------------------------------------------------------------------ // alles ohne Which-ID, Map nur fuer PropertySetInfo @@ -1992,10 +1990,10 @@ void SAL_CALL ScDatabaseRangeObj::addRefreshListener( SolarMutexGuard aGuard; uno::Reference<util::XRefreshListener>* pObj = new uno::Reference<util::XRefreshListener>( xListener ); - aRefreshListeners.Insert( pObj, aRefreshListeners.Count() ); + aRefreshListeners.push_back( pObj ); // hold one additional ref to keep this object alive as long as there are listeners - if ( aRefreshListeners.Count() == 1 ) + if ( aRefreshListeners.size() == 1 ) acquire(); } @@ -2004,14 +2002,14 @@ void SAL_CALL ScDatabaseRangeObj::removeRefreshListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - sal_uInt16 nCount = aRefreshListeners.Count(); + sal_uInt16 nCount = aRefreshListeners.size(); for ( sal_uInt16 n=nCount; n--; ) { - uno::Reference<util::XRefreshListener>* pObj = aRefreshListeners[n]; - if ( *pObj == xListener ) + uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n]; + if ( rObj == xListener ) { - aRefreshListeners.DeleteAndDestroy( n ); - if ( aRefreshListeners.Count() == 0 ) + aRefreshListeners.erase( aRefreshListeners.begin() + n ); + if ( aRefreshListeners.empty() ) release(); // release ref for listeners break; } @@ -2022,8 +2020,8 @@ void ScDatabaseRangeObj::Refreshed_Impl() { lang::EventObject aEvent; aEvent.Source = (cppu::OWeakObject*)this; - for ( sal_uInt16 n=0; n<aRefreshListeners.Count(); n++ ) - (*aRefreshListeners[n])->refreshed( aEvent ); + for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ ) + aRefreshListeners[n]->refreshed( aEvent ); } // XCellRangeSource |