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:
Vadim Zeitlin
2006-12-04 17:07:57 +00:00
parent 19def5e7e6
commit a502b2841d

View File

@@ -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();