diff options
-rw-r--r-- | include/vcl/vclevent.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/svdata.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 7 | ||||
-rw-r--r-- | vcl/source/app/vclevent.cxx | 8 |
4 files changed, 11 insertions, 8 deletions
diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx index 982958c419ae..f9e8b51564e0 100644 --- a/include/vcl/vclevent.hxx +++ b/include/vcl/vclevent.hxx @@ -259,7 +259,7 @@ public: void addListener( const Link<>& rListener ); void removeListener( const Link<>& rListener ); private: - std::list<Link<>> m_aListeners; + std::vector<Link<>> m_aListeners; }; class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index bb22ad692ed1..0d8e02c8e110 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -101,7 +101,7 @@ public: virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) SAL_OVERRIDE; }; -typedef std::list<Link<VclWindowEvent&,bool> > SVAppKeyListeners; +typedef std::vector<Link<VclWindowEvent&,bool> > SVAppKeyListeners; struct ImplSVAppData { diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 789da507e7ed..8f561725fc65 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -700,7 +700,10 @@ void Application::RemoveKeyListener( const Link<VclWindowEvent&,bool>& rKeyListe { ImplSVData* pSVData = ImplGetSVData(); if( pSVData->maAppData.mpKeyListeners ) - pSVData->maAppData.mpKeyListeners->remove( rKeyListener ); + { + auto pVec = pSVData->maAppData.mpKeyListeners; + pVec->erase( std::remove(pVec->begin(), pVec->end(), rKeyListener ), pVec->end() ); + } } bool Application::HandleKey( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKeyEvent ) @@ -718,7 +721,7 @@ bool Application::HandleKey( sal_uLong nEvent, vcl::Window *pWin, KeyEvent* pKey bool bProcessed = false; // Copy the list, because this can be destroyed when calling a Link... - std::list<Link<VclWindowEvent&,bool>> aCopy( *pSVData->maAppData.mpKeyListeners ); + std::vector<Link<VclWindowEvent&,bool>> aCopy( *pSVData->maAppData.mpKeyListeners ); for ( Link<VclWindowEvent&,bool>& rLink : aCopy ) { if( rLink.Call( aEvent ) ) diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 00a016d53b80..bc3ca538f285 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -48,9 +48,9 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const return; // Copy the list, because this can be destroyed when calling a Link... - std::list<Link<>> aCopy( m_aListeners ); - std::list<Link<>>::iterator aIter( aCopy.begin() ); - std::list<Link<>>::const_iterator aEnd( aCopy.end() ); + std::vector<Link<>> aCopy( m_aListeners ); + std::vector<Link<>>::iterator aIter( aCopy.begin() ); + std::vector<Link<>>::const_iterator aEnd( aCopy.end() ); if( pEvent->IsA( VclWindowEvent::StaticType() ) ) { VclWindowEvent* pWinEvent = static_cast<VclWindowEvent*>(pEvent); @@ -83,7 +83,7 @@ void VclEventListeners::addListener( const Link<>& rListener ) void VclEventListeners::removeListener( const Link<>& rListener ) { - m_aListeners.remove( rListener ); + m_aListeners.erase( std::remove(m_aListeners.begin(), m_aListeners.end(), rListener ), m_aListeners.end() ); } VclEventListeners2::VclEventListeners2() |