Fix showing cells without values in wxDataViewCtrl

Fix regression introduced in a49567109a: cells
without value, i.e. for which the wxVariant returned from GetValue() is not
set at all, should appear as empty, not reuse the last value used by this
renderer.
This commit is contained in:
Vadim Zeitlin 2015-10-12 01:13:56 +02:00
parent f9334fda39
commit f68c88b8d2

View File

@ -813,12 +813,14 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
const wxDataViewItem& item,
unsigned column)
{
// Now check if we have a value and remember it if we do.
// 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.
const wxVariant& value = CheckedGetValue(model, item, column);
if ( !value.IsNull() )
{
SetValue(value);
if ( !value.IsNull() )
{
// Also set up the attributes for this item if it's not empty.
wxDataViewItemAttr attr;
model->GetAttr(item, column, attr);