summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/svapp.cxx7
-rw-r--r--vcl/source/app/vclevent.cxx8
2 files changed, 9 insertions, 6 deletions
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()