From e067e4233caf691d52b52bd146568de697de8311 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 24 May 2021 15:15:17 +0200 Subject: [PATCH] Revert "Fix showing cells without values in wxDataViewCtrl" This reverts commit f68c88b8d2850d233855c6417f60cc980e861608 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. --- src/common/datavcmn.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 1f5fd4d66b..07d4ea214a 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -884,21 +884,19 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model, wxTRY { - // Now check if we have a value and remember it for rendering it later. - // Notice that we do it even if it's null, as the cell should be empty then - // and not show the last used value. + // Now check if we have a value and remember it if we do. wxVariant value = CheckedGetValue(model, item, column); - if ( m_valueAdjuster ) - { - if ( IsHighlighted() ) - value = m_valueAdjuster->MakeHighlighted(value); - } - - SetValue(value); - 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. wxDataViewItemAttr attr; model->GetAttr(item, column, attr);