evolution r35861 - in trunk/calendar: . gui



Author: mcrha
Date: Tue Jul 29 16:38:30 2008
New Revision: 35861
URL: http://svn.gnome.org/viewvc/evolution?rev=35861&view=rev

Log:
2008-07-29  Milan Crha  <mcrha redhat com>

	** Fix for bug #329821

	* gui/e-calendar-table.c: (query_tooltip_cb):
	Recalculate returned row to the model row, if we are sorting.



Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/e-calendar-table.c

Modified: trunk/calendar/gui/e-calendar-table.c
==============================================================================
--- trunk/calendar/gui/e-calendar-table.c	(original)
+++ trunk/calendar/gui/e-calendar-table.c	Tue Jul 29 16:38:30 2008
@@ -296,6 +296,8 @@
 	icaltimezone *zone, *default_zone;
 	GSList *desc, *p;
 	int len;
+	ETable *etable;
+	ESelectionModel *esm;
 
 	if (keyboard_mode)
 		return FALSE;
@@ -306,10 +308,16 @@
 
 	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;



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