Fix wxGenericListCtrl autosizing after deleting all its items.

Set bNeedsUpdate flag for all columns even when the control is already empty,
this ensures that things will work if more items are added to it later.

See #10326.
This commit is contained in:
Vadim Zeitlin 2015-03-19 16:38:36 +01:00
parent c3e5751c36
commit 0e2d9e539c

View File

@ -4070,6 +4070,13 @@ void wxListMainWindow::DeleteColumn( int col )
void wxListMainWindow::DoDeleteAllItems()
{
// We will need to update all columns if any items are inserted again.
if ( InReportView() )
{
for ( size_t i = 0; i < m_aColWidths.GetCount(); i++ )
m_aColWidths.Item(i)->bNeedsUpdate = true;
}
if ( IsEmpty() )
// nothing to do - in particular, don't send the event
return;
@ -4092,13 +4099,7 @@ void wxListMainWindow::DoDeleteAllItems()
}
if ( InReportView() )
{
ResetVisibleLinesRange();
for (size_t i = 0; i < m_aColWidths.GetCount(); i++)
{
m_aColWidths.Item(i)->bNeedsUpdate = true;
}
}
m_lines.Clear();
}