fix a problem with (sometimes) editing an invalid item in EditLabel() (Tim Kosse)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2910,8 +2910,15 @@ wxTextCtrl *wxListMainWindow::EditLabel(long item, wxClassInfo* textControlClass
|
||||
// We have to call this here because the label in question might just have
|
||||
// been added and no screen update taken place.
|
||||
if ( m_dirty )
|
||||
{
|
||||
wxSafeYield();
|
||||
|
||||
// Pending events dispatched by wxSafeYield might have changed the item
|
||||
// count
|
||||
if ( (size_t)item >= GetItemCount() )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxTextCtrl * const text = (wxTextCtrl *)textControlClass->CreateObject();
|
||||
m_textctrlWrapper = new wxListTextCtrlWrapper(this, text, item);
|
||||
return m_textctrlWrapper->GetText();
|
||||
|
Reference in New Issue
Block a user