From 7742a1e98b0a021812d09dda112cf5b51db7e096 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 29 Jul 2008 16:38:30 +0000 Subject: ** Fix for bug #329821 2008-07-29 Milan Crha ** Fix for bug #329821 * gui/e-calendar-table.c: (query_tooltip_cb): Recalculate returned row to the model row, if we are sorting. svn path=/trunk/; revision=35861 --- calendar/gui/e-calendar-table.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 de9578af93..4038c73c04 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -296,6 +296,8 @@ query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, Gtk icaltimezone *zone, *default_zone; GSList *desc, *p; int len; + ETable *etable; + ESelectionModel *esm; if (keyboard_mode) return FALSE; @@ -306,10 +308,16 @@ query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, Gtk cal_table = E_CALENDAR_TABLE (user_data); - e_table_get_mouse_over_cell (e_calendar_table_get_table (cal_table), x, y, &row, &col); - if (row == -1) + etable = e_calendar_table_get_table (cal_table); + e_table_get_mouse_over_cell (etable, x, y, &row, &col); + if (row == -1 || !etable) return FALSE; + /* respect sorting option, the 'e_table_get_mouse_over_cell' returns sorted row, not the model one */ + esm = e_table_get_selection_model (etable); + if (esm && esm->sorter && e_sorter_needs_sorting (esm->sorter)) + row = e_sorter_sorted_to_model (esm->sorter, row); + comp = e_cal_model_get_component_at (cal_table->model, row); if (!comp || !comp->icalcomp) return FALSE; -- cgit