Don't warn if model cell value is empty in wxOSX wxDVC.
This follows similar change to wxGTK a few commits ago and makes wxOSX consistent with the generic version. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1766,9 +1766,27 @@ outlineView:(NSOutlineView*)outlineView
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wxDataViewRenderer * const renderer = dvCol->GetRenderer();
|
wxDataViewRenderer * const renderer = dvCol->GetRenderer();
|
||||||
|
wxDataViewRendererNativeData * const data = renderer->GetNativeData();
|
||||||
|
|
||||||
|
// let the renderer know about what it's going to render next
|
||||||
|
data->SetColumnPtr(tableColumn);
|
||||||
|
data->SetItem(item);
|
||||||
|
data->SetItemCell(cell);
|
||||||
|
|
||||||
|
// set the state (enabled/disabled) of the item: this must be done first as
|
||||||
|
// even if we return below because the cell is empty, it still needs to be
|
||||||
|
// disabled if it's not supposed to be enabled
|
||||||
|
renderer->OSXApplyEnabled(model->IsEnabled(dvItem, colIdx));
|
||||||
|
|
||||||
|
// check if we have anything to render
|
||||||
wxVariant value;
|
wxVariant value;
|
||||||
model->GetValue(value, dvItem, colIdx);
|
model->GetValue(value, dvItem, colIdx);
|
||||||
|
if ( value.IsNull() )
|
||||||
|
{
|
||||||
|
// for consistency with the generic implementation, just handle missing
|
||||||
|
// values as blank
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( value.GetType() != renderer->GetVariantType() )
|
if ( value.GetType() != renderer->GetVariantType() )
|
||||||
{
|
{
|
||||||
@@ -1781,13 +1799,6 @@ outlineView:(NSOutlineView*)outlineView
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDataViewRendererNativeData * const data = renderer->GetNativeData();
|
|
||||||
|
|
||||||
// let the renderer know about what it's going to render next
|
|
||||||
data->SetColumnPtr(tableColumn);
|
|
||||||
data->SetItem(item);
|
|
||||||
data->SetItemCell(cell);
|
|
||||||
|
|
||||||
// use the attributes: notice that we need to do this whether we have them
|
// use the attributes: notice that we need to do this whether we have them
|
||||||
// or not as even if this cell doesn't have any attributes, the previous
|
// or not as even if this cell doesn't have any attributes, the previous
|
||||||
// one might have had some and then we need to reset them back to default
|
// one might have had some and then we need to reset them back to default
|
||||||
@@ -1795,9 +1806,6 @@ outlineView:(NSOutlineView*)outlineView
|
|||||||
model->GetAttr(dvItem, colIdx, attr);
|
model->GetAttr(dvItem, colIdx, attr);
|
||||||
renderer->OSXApplyAttr(attr);
|
renderer->OSXApplyAttr(attr);
|
||||||
|
|
||||||
// set the state (enabled/disabled) of the item
|
|
||||||
renderer->OSXApplyEnabled(model->IsEnabled(dvItem, colIdx));
|
|
||||||
|
|
||||||
// and finally do draw it
|
// and finally do draw it
|
||||||
renderer->MacRender();
|
renderer->MacRender();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user