Remove duplicated HasValue() call from wxGTK wxDataViewCtrl code
HasValue() is already called by PrepareForItem(), so there is no need to call it explicitly from wxGTK code, just rely on PrepareForItem() returning false if there is no value to show -- we can skip the call to GtkSetCurrentItem() in this case, this function is cheap, and we lose more by calling HasValue() twice in the common case than we save on not calling it. No real changes.
This commit is contained in:
@@ -3225,13 +3225,10 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
|
||||
|
||||
wxDataViewModel *wx_model = tree_model->internal->GetDataViewModel();
|
||||
|
||||
gboolean visible = wx_model->HasValue(item, column);
|
||||
if ( visible )
|
||||
{
|
||||
cell->GtkSetCurrentItem(item);
|
||||
cell->GtkSetCurrentItem(item);
|
||||
|
||||
visible = cell->PrepareForItem(wx_model, item, column);
|
||||
}
|
||||
// Cells without values shouldn't be rendered at all.
|
||||
const bool visible = cell->PrepareForItem(wx_model, item, column);
|
||||
|
||||
wxGtkValue gvalue( G_TYPE_BOOLEAN );
|
||||
g_value_set_boolean( gvalue, visible );
|
||||
|
||||
Reference in New Issue
Block a user