Re: [evolution-patches] [calendar] fix for bug #273796



Modified patch is attached here

Regards,
Dinesh


On Tue, 2005-09-27 at 11:41 +0000, chen  wrote:
> On Thu, 2005-09-22 at 09:10 -0600, Dinesh Layek wrote:
> >                if (event && event->comp_data)
> >                  
> What is the reason for event->comp_data being NULL ?
> 
> thanks, Chenthill.
Index: gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.286
diff -u -p -r1.286 e-day-view.c
--- gui/e-day-view.c	24 Aug 2005 03:07:49 -0000	1.286
+++ gui/e-day-view.c	5 Oct 2005 12:16:00 -0000
@@ -3015,6 +3015,19 @@ e_day_view_on_long_event_button_press (E
 }
 
 
+static char*
+strstrip (char *str)
+{
+	if (!str)
+		return NULL;
+	while (*str == ' ')
+		str = str+1;
+	while (*str && str[strlen  (str)-1] == ' ')
+		str[strlen (str)-1] = 0;
+	return str;
+}
+
+
 static gboolean
 e_day_view_on_event_button_press (EDayView	  *day_view,
 				  gint		   day,
@@ -3042,11 +3055,24 @@ e_day_view_on_event_button_press (EDayVi
 
 		e = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
 
+		if (pos == E_CALENDAR_VIEW_POS_EVENT && E_TEXT (e->canvas_item)->text) {
+			char *str;
+			str = E_TEXT (e->canvas_item)->text;
+			str = strstrip (str);
+			if (!strcmp (str, ""))
+				event_num = -1;
+		}
+
 		if (!GTK_WIDGET_HAS_FOCUS (day_view))
 			gtk_widget_grab_focus (GTK_WIDGET (day_view));
 
 		e_day_view_set_selected_time_range_visible (day_view, e->start, e->end);
 	
+		if (day_view->events[day]->len <= event_num) {
+			event_num = -1;
+			return TRUE;
+		}
+
 		e_day_view_on_event_right_click (day_view, event,
 						 day, event_num);
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2825
diff -u -p -r1.2825 ChangeLog
--- ChangeLog	3 Oct 2005 11:20:50 -0000	1.2825
+++ ChangeLog	5 Oct 2005 12:17:10 -0000
@@ -1,3 +1,8 @@
+2005-10-05  Dinesh Layek <LDinesh novell com>
+	
+	* gui/e-day-view.c (e_day_view_on_event_button_press): removed the selection
+	when entered text is null.
+
 2005-10-02  Srinivasa Ragavan <sragavan novell com>
 	
 	Provides across calendars keyboard accelerators for popup menus


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