From fddf5b78aa9a2752da83b2c417312ef66b759d40 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Dec 2014 01:31:10 +0000 Subject: [PATCH] Don't warn if model cell value is empty in wxGTK wxDVC. Make wxGTK consistent with the generic version and, generally speaking, more reasonable by allowing to leave any cell empty by just not filling in the wxVariant in the model GetValue() for it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dataview.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index d7a2512c3f..04cef4bf1e 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -2911,12 +2911,17 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column), wxVariant value; wx_model->GetValue( value, item, cell->GetOwner()->GetModelColumn() ); - if (value.GetType() != cell->GetVariantType()) + // It is always possible to leave a cell empty, don't warn about type + // mismatch in this case. + if (!value.IsNull()) { - wxLogDebug("Wrong type returned from the model: " - "%s required but actual type is %s", - cell->GetVariantType(), - value.GetType()); + if (value.GetType() != cell->GetVariantType()) + { + wxLogDebug("Wrong type returned from the model: " + "%s required but actual type is %s", + cell->GetVariantType(), + value.GetType()); + } } cell->SetValue( value );