crash in OnChar() for empty list control fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7530 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1969,12 +1969,15 @@ void wxListMainWindow::OnChar( wxKeyEvent &event )
|
|||||||
wxWindow *parent = GetParent();
|
wxWindow *parent = GetParent();
|
||||||
|
|
||||||
/* we send a list_key event up */
|
/* we send a list_key event up */
|
||||||
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
|
if ( m_current )
|
||||||
le.m_itemIndex = GetIndexOfLine( m_current );
|
{
|
||||||
m_current->GetItem( 0, le.m_item );
|
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
|
||||||
le.m_code = (int)event.KeyCode();
|
le.m_itemIndex = GetIndexOfLine( m_current );
|
||||||
le.SetEventObject( parent );
|
m_current->GetItem( 0, le.m_item );
|
||||||
parent->GetEventHandler()->ProcessEvent( le );
|
le.m_code = (int)event.KeyCode();
|
||||||
|
le.SetEventObject( parent );
|
||||||
|
parent->GetEventHandler()->ProcessEvent( le );
|
||||||
|
}
|
||||||
|
|
||||||
/* we propagate the char event up */
|
/* we propagate the char event up */
|
||||||
wxKeyEvent ke( wxEVT_CHAR );
|
wxKeyEvent ke( wxEVT_CHAR );
|
||||||
|
Reference in New Issue
Block a user