Revert "Fix showing cells without values in wxDataViewCtrl"

This reverts commit f68c88b8d2 which
doesn't seem necessary any longer: the originally observed problem can't
be reproduced in contemporary macOS versions (10.14+), while calling
SetValue() even for null values results in asserts from several
renderers which don't expect this to happen.

This commit is best viewed ignoring whitespace-only changes.

Closes #18934.
This commit is contained in:
Vadim Zeitlin
2021-05-24 15:15:17 +02:00
parent 43ace6193a
commit e067e4233c

View File

@@ -884,21 +884,19 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
wxTRY wxTRY
{ {
// Now check if we have a value and remember it for rendering it later. // Now check if we have a value and remember it if we do.
// Notice that we do it even if it's null, as the cell should be empty then
// and not show the last used value.
wxVariant value = CheckedGetValue(model, item, column); wxVariant value = CheckedGetValue(model, item, column);
if ( m_valueAdjuster )
{
if ( IsHighlighted() )
value = m_valueAdjuster->MakeHighlighted(value);
}
SetValue(value);
if ( !value.IsNull() ) if ( !value.IsNull() )
{ {
if ( m_valueAdjuster )
{
if ( IsHighlighted() )
value = m_valueAdjuster->MakeHighlighted(value);
}
SetValue(value);
// Also set up the attributes for this item if it's not empty. // Also set up the attributes for this item if it's not empty.
wxDataViewItemAttr attr; wxDataViewItemAttr attr;
model->GetAttr(item, column, attr); model->GetAttr(item, column, attr);