wxDVC: Don't calculate hidden columns' widths
Don't call wxDataViewColumn::GetWidth() in OnPaint() for columns that are hidden: they won't be drawn and their width won't affect anything. The call looks deceptively simple, but may invoke best width recalculation that can be very expensive on large models.
This commit is contained in:
@@ -2508,11 +2508,13 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
for (unsigned int i = col_start; i < col_last; i++)
|
for (unsigned int i = col_start; i < col_last; i++)
|
||||||
{
|
{
|
||||||
wxDataViewColumn *col = GetOwner()->GetColumnAt( i );
|
wxDataViewColumn *col = GetOwner()->GetColumnAt( i );
|
||||||
|
if ( col->IsHidden() )
|
||||||
|
continue; // skip it!
|
||||||
|
|
||||||
wxDataViewRenderer *cell = col->GetRenderer();
|
wxDataViewRenderer *cell = col->GetRenderer();
|
||||||
cell_rect.width = col->GetWidth();
|
cell_rect.width = col->GetWidth();
|
||||||
|
if ( cell_rect.width <= 0 )
|
||||||
if ( col->IsHidden() || cell_rect.width <= 0 )
|
continue;
|
||||||
continue; // skip it!
|
|
||||||
|
|
||||||
cell_rect.y = first_line_start;
|
cell_rect.y = first_line_start;
|
||||||
for (unsigned int item = item_start; item < item_last; item++)
|
for (unsigned int item = item_start; item < item_last; item++)
|
||||||
|
Reference in New Issue
Block a user