summaryrefslogtreecommitdiff
path: root/vcl/source/app/svapp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-11 09:21:55 +0200
committerNoel Grandin <noel@peralex.com>2015-09-14 10:00:43 +0200
commitbcb5756cb0997923ea565459440767e22ce34e7d (patch)
tree11c55ec2f41696bbe8b0204e90aa88fd9d74f3c6 /vcl/source/app/svapp.cxx
parent8f2aace934eb2a91a273b6104de6383108b5c82a (diff)
list->vector
since we are copying these before iterating over them, we don't need the iterator guarantees of std::list Change-Id: I9cb2048e1527f37104c3077e69b5f3b827f08c7b
Diffstat (limited to 'vcl/source/app/svapp.cxx')
-rw-r--r--vcl/source/app/svapp.cxx7
1 files changed, 5 insertions, 2 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 ) )