From 509e87d05379f7bd7ecf842e7114ccaa9a3d6020 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 Jun 2012 11:17:49 +0200 Subject: Convert SV_DECL_PTR_ARR_DEL(XStatusListenerArr_Impl) to ptr_vector Change-Id: I2375831167dff55b7906cc7ae8c8a1b53fc88125 --- sc/source/ui/unoobj/dispuno.cxx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'sc/source/ui/unoobj') diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 11c48552f597..7d0c2e965b16 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -50,10 +50,6 @@ const char* cURLDocDataSource = ".uno:DataSourceBrowser/DocumentDataSource"; //------------------------------------------------------------------------ -SV_IMPL_PTRARR( XStatusListenerArr_Impl, XStatusListenerPtr ); - -//------------------------------------------------------------------------ - uno::Reference lcl_GetSelectionSupplier( SfxViewShell* pViewShell ) { if ( pViewShell ) @@ -307,7 +303,7 @@ void SAL_CALL ScDispatch::addStatusListener( { uno::Reference* pObj = new uno::Reference( xListener ); - aDataSourceListeners.Insert( pObj, aDataSourceListeners.Count() ); + aDataSourceListeners.push_back( pObj ); if (!bListeningToView) { @@ -336,18 +332,18 @@ void SAL_CALL ScDispatch::removeStatusListener( if ( !aURL.Complete.compareToAscii(cURLDocDataSource) ) { - sal_uInt16 nCount = aDataSourceListeners.Count(); + sal_uInt16 nCount = aDataSourceListeners.size(); for ( sal_uInt16 n=nCount; n--; ) { - uno::Reference *pObj = aDataSourceListeners[n]; - if ( *pObj == xListener ) + uno::Reference& rObj = aDataSourceListeners[n]; + if ( rObj == xListener ) { - aDataSourceListeners.DeleteAndDestroy( n ); + aDataSourceListeners.erase( aDataSourceListeners.begin() + n ); break; } } - if ( aDataSourceListeners.Count() == 0 && pViewShell ) + if ( aDataSourceListeners.empty() && pViewShell ) { uno::Reference xSupplier(lcl_GetSelectionSupplier( pViewShell )); if ( xSupplier.is() ) @@ -384,8 +380,8 @@ void SAL_CALL ScDispatch::selectionChanged( const ::com::sun::star::lang::EventO lcl_FillDataSource( aEvent, aNewImport ); // modifies State, IsEnabled - for ( sal_uInt16 n=0; nstatusChanged( aEvent ); + for ( sal_uInt16 n=0; nstatusChanged( aEvent ); aLastImport = aNewImport; } @@ -403,8 +399,8 @@ void SAL_CALL ScDispatch::disposing( const ::com::sun::star::lang::EventObject& lang::EventObject aEvent; aEvent.Source.set(static_cast(this)); - for ( sal_uInt16 n=0; ndisposing( aEvent ); + for ( sal_uInt16 n=0; ndisposing( aEvent ); pViewShell = NULL; } -- cgit