Fix wxNullVariant handling in wxDataViewBitmapRenderer

In both the generic and GTK+ implementations, setting the value of a
bitmap column to wxNullVariant resulted in the bitmap, if set for some
rows, being repeated on the rows with null value.

(cherry picked from commit f3b8dac3b7)
This commit is contained in:
Václav Slavík
2016-10-19 16:46:54 +02:00
parent 4e7f160100
commit 34527f7473
2 changed files with 11 additions and 2 deletions

View File

@@ -1035,9 +1035,18 @@ wxDataViewBitmapRenderer::wxDataViewBitmapRenderer( const wxString &varianttype,
bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value )
{
if (value.GetType() == wxT("wxBitmap"))
{
m_bitmap << value;
if (value.GetType() == wxT("wxIcon"))
}
else if (value.GetType() == wxT("wxIcon"))
{
m_icon << value;
}
else
{
m_icon = wxNullIcon;
m_bitmap = wxNullBitmap;
}
return true;
}

View File

@@ -2288,7 +2288,7 @@ bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value )
}
else
{
return false;
SetPixbufProp(m_renderer, NULL);
}
return true;