Don't assert if no icon is specified for a wxDataViewCtrl item.
An item in a column using wxDataViewIconTextRenderer might not have any valid icon associated with it, don't assert in case it doesn't in the native GTK version. Notice that the generic wxDataViewCtrl implementation already supports this but not perfectly: no space is reserved for the icon in the images without one, so giving the image to only some of them looks ugly. The GTK version aligns both the items with and without icon properly and simply leaves the image part blank and it would be better to modify the generic version to do the same thing in the future. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2792,7 +2792,9 @@ bool wxDataViewIconTextRenderer::SetValue( const wxVariant &value )
|
||||
m_value << value;
|
||||
|
||||
SetTextValue(m_value.GetText());
|
||||
SetPixbufProp(m_rendererIcon, m_value.GetIcon().GetPixbuf());
|
||||
|
||||
const wxIcon& icon = m_value.GetIcon();
|
||||
SetPixbufProp(m_rendererIcon, icon.IsOk() ? icon.GetPixbuf() : NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user