Fix wxIcon wxDVC columns under wxGTK
b376d1402b
accidentally broke columns
with wxIcon type. Contrary to that commit's assumption, operator<<
cannot convert wxIcon to wxBitmap and asserts:
src/common/bmpbase.cpp(33): assert "variant.GetType() == "wxBitmap"" failed in operator<<().
Fixed by restoring explicit conversion.
This commit is contained in:
parent
7ca4705bd7
commit
c817a434d8
@ -2562,8 +2562,16 @@ wxDataViewBitmapRenderer::wxDataViewBitmapRenderer( const wxString &varianttype,
|
|||||||
bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value )
|
bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value )
|
||||||
{
|
{
|
||||||
wxBitmap bitmap;
|
wxBitmap bitmap;
|
||||||
if (value.GetType() == wxS("wxBitmap") || value.GetType() == wxS("wxIcon"))
|
if (value.GetType() == wxS("wxBitmap"))
|
||||||
|
{
|
||||||
bitmap << value;
|
bitmap << value;
|
||||||
|
}
|
||||||
|
else if (value.GetType() == wxS("wxIcon"))
|
||||||
|
{
|
||||||
|
wxIcon icon;
|
||||||
|
icon << value;
|
||||||
|
bitmap.CopyFromIcon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __WXGTK3__
|
#ifdef __WXGTK3__
|
||||||
WX_CELL_RENDERER_PIXBUF(m_renderer)->Set(bitmap);
|
WX_CELL_RENDERER_PIXBUF(m_renderer)->Set(bitmap);
|
||||||
|
Loading…
Reference in New Issue
Block a user