Return false from PrepareForItem() if there is no value

This corresponds to the behaviour described in the comment and is more
useful than always returning true.
This commit is contained in:
Vadim Zeitlin
2021-11-30 23:03:28 +00:00
parent 26c6273a70
commit 95b7a2f183

View File

@@ -913,16 +913,15 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
// empty cells.
SetEnabled(model->IsEnabled(item, column));
return !value.IsNull();
}
wxCATCH_ALL
(
// There is not much we can do about it here, just log it and don't
// show anything in this cell.
wxLogDebug("Retrieving the value from the model threw an exception");
SetValue(wxVariant());
return false;
)
return true;
}