[gtk+] Make gtk_combo_box_entry_set_text_column more forgiving



commit d6f3af077782527a26debc81740600b1abba605b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 4 22:20:28 2009 -0400

    Make gtk_combo_box_entry_set_text_column more forgiving
    
    The assertions in there were unnecessarily restrictive. This has
    been reported in bug 564160.

 gtk/gtkcomboboxentry.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcomboboxentry.c b/gtk/gtkcomboboxentry.c
index 93ae5ae..c63c085 100644
--- a/gtk/gtkcomboboxentry.c
+++ b/gtk/gtkcomboboxentry.c
@@ -368,9 +368,10 @@ void
 gtk_combo_box_entry_set_text_column (GtkComboBoxEntry *entry_box,
                                      gint              text_column)
 {
+  GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (entry_box));
+
   g_return_if_fail (text_column >= 0);
-  g_return_if_fail (text_column < gtk_tree_model_get_n_columns (gtk_combo_box_get_model (GTK_COMBO_BOX (entry_box))));
-  g_return_if_fail (entry_box->priv->text_column == -1);
+  g_return_if_fail (model == NULL || text_column < gtk_tree_model_get_n_columns (model));
 
   entry_box->priv->text_column = text_column;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]