From e23b289ac095c32ad706f019f4642ad69760fa64 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Wed, 14 Nov 2001 21:22:59 +0000 Subject: don't abort when e_table_selected_count() returns odd values. There seems 2001-11-14 Damon Chaplin * gui/e-calendar-table.c: don't abort when e_table_selected_count() returns odd values. There seems to be a bug in ETable. This is to avoid bug #13843. svn path=/trunk/; revision=14705 --- calendar/gui/e-calendar-table.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'calendar/gui/e-calendar-table.c') diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 545a5a146f..d475f4a603 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -659,7 +659,8 @@ get_selected_comp (ECalendarTable *cal_table) int row; etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)); - g_assert (e_table_selected_count (etable) == 1); + if (e_table_selected_count (etable) != 1) + return NULL; row = -1; e_table_selected_row_foreach (etable, @@ -755,7 +756,8 @@ e_calendar_table_delete_selected (ECalendarTable *cal_table) etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)); n_selected = e_table_selected_count (etable); - g_assert (n_selected > 0); + if (n_selected <= 0) + return; if (n_selected == 1) comp = get_selected_comp (cal_table); @@ -974,7 +976,8 @@ e_calendar_table_on_right_click (ETable *table, int disable_mask = 0; n_selected = e_table_selected_count (table); - g_assert (n_selected > 0); + if (n_selected <= 0) + return TRUE; if (n_selected == 1) hide_mask = MASK_MULTIPLE; @@ -998,7 +1001,8 @@ e_calendar_table_on_open_task (GtkWidget *menuitem, cal_table = E_CALENDAR_TABLE (data); comp = get_selected_comp (cal_table); - open_task (cal_table, comp); + if (comp) + open_task (cal_table, comp); } static void -- cgit v1.2.3