From e76b6481c69c9a84decea8bcf345a26a4a408462 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 1 Apr 2012 10:52:46 +0900 Subject: Fix for 950677 : Add stops and repeat controls to the gradient toolbar (bzr r11134) --- src/ege-select-one-action.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ege-select-one-action.cpp') diff --git a/src/ege-select-one-action.cpp b/src/ege-select-one-action.cpp index f2c97cdc4..42f2fafce 100644 --- a/src/ege-select-one-action.cpp +++ b/src/ege-select-one-action.cpp @@ -826,6 +826,7 @@ GtkWidget* create_tool_item( GtkAction* action ) g_signal_connect( G_OBJECT(normal), "changed", G_CALLBACK(combo_changed_cb), action ); g_object_set_data( G_OBJECT(holder), "ege-combo-box", normal ); + g_object_set_data( G_OBJECT(act), "ege-combo-box", normal ); if (act->private_data->appearanceMode == APPEARANCE_COMPACT) { gchar* sss = 0; @@ -1002,7 +1003,7 @@ void resync_sensitive( EgeSelectOneAction* act ) void combo_changed_cb( GtkComboBox* widget, gpointer user_data ) { EgeSelectOneAction *act = EGE_SELECT_ONE_ACTION(user_data); - gchar *text; + gchar *text = 0; GtkComboBox *cb = GTK_COMBO_BOX (widget); gint newActive = gtk_combo_box_get_active(widget); @@ -1029,6 +1030,11 @@ void combo_changed_cb( GtkComboBox* widget, gpointer user_data ) text = gtk_combo_box_get_active_text (cb); #endif + if (!text) { + /* User probably deleted the data in the model */ + return; + } + if (newActive == -1) { /* indicates the user is entering text for a custom aka "open" value */ if (act->private_data->pendingText && text && (strcmp(act->private_data->pendingText, text) == 0) ) { -- cgit v1.2.3