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:
parent
f9334fda39
commit
f68c88b8d2
@ -813,12 +813,14 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
|
|||||||
const wxDataViewItem& item,
|
const wxDataViewItem& item,
|
||||||
unsigned column)
|
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);
|
const wxVariant& value = CheckedGetValue(model, item, column);
|
||||||
|
SetValue(value);
|
||||||
|
|
||||||
if ( !value.IsNull() )
|
if ( !value.IsNull() )
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user