From 530a50ecf00d2f5494cca07531f9a83b63878326 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 May 2012 21:37:16 +0000 Subject: [PATCH] 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 --- src/gtk/dataview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 31fa32fbe1..01fad1c67c 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -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; } -- 2.45.2