Fixed use of map::erase() in ClearActionTriggers() (this bug was revealed by static code analysis - see ticket )

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2009-09-14 14:53:13 +00:00
parent 02ca710b3b
commit 36a2b429ae

View File

@ -5232,14 +5232,25 @@ void wxPropertyGrid::AddActionTrigger( int action, int keycode, int modifiers )
void wxPropertyGrid::ClearActionTriggers( int action )
{
wxPGHashMapI2I::iterator it;
bool didSomething;
for ( it = m_actionTriggers.begin(); it != m_actionTriggers.end(); ++it )
do
{
if ( it->second == action )
didSomething = false;
for ( it = m_actionTriggers.begin();
it != m_actionTriggers.end();
it++ )
{
m_actionTriggers.erase(it);
if ( it->second == action )
{
m_actionTriggers.erase(it);
didSomething = true;
break;
}
}
}
while ( didSomething );
}
void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )