Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.564
diff -u -p -r1.564 ChangeLog
--- ChangeLog	20 Feb 2006 10:25:14 -0000	1.564
+++ ChangeLog	28 Feb 2006 12:10:38 -0000
@@ -1,3 +1,11 @@
+2006-02-28  Chenthill Palanisamy  <pchenthill@novell.com>
+
+	Fixes #332726
+	* backends/file/e-cal-backend-file.c:
+	(e_cal_backend_file_modify_object): Initialize and assign
+	the recurrence id properly. Set the date and times of the 
+	master object depending on what has changed.
+
 2006-02-20  Harish Krishnaswamy  <kharish@novell.com>
 
 	* backends/caldav/Makefile.am: Add soup_flags to la.
Index: backends/file/e-cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/file/e-cal-backend-file.c,v
retrieving revision 1.71
diff -u -p -r1.71 e-cal-backend-file.c
--- backends/file/e-cal-backend-file.c	10 Feb 2006 06:36:09 -0000	1.71
+++ backends/file/e-cal-backend-file.c	28 Feb 2006 12:10:40 -0000
@@ -1808,7 +1808,7 @@ e_cal_backend_file_modify_object (ECalBa
 	ECalBackendFile *cbfile;
 	ECalBackendFilePrivate *priv;
 	icalcomponent *icalcomp;
-	const char *comp_uid, *rid;
+	const char *comp_uid, *rid = NULL;
 	char *real_rid;
 	ECalComponent *comp, *recurrence;
 	ECalBackendFileObject *obj_data;
@@ -1850,11 +1850,11 @@ e_cal_backend_file_modify_object (ECalBa
 
 	/* sanitize the component*/
 	sanitize_component (cbfile, comp);
+	rid = e_cal_component_get_recurid_as_string (comp);
 
 	/* handle mod_type */
 	switch (mod) {
 	case CALOBJ_MOD_THIS :
-		rid = e_cal_component_get_recurid_as_string (comp);
 		if (!rid || !*rid) {
 			if (old_object)
 				*old_object = e_cal_component_get_as_string (obj_data->full_object);
@@ -1967,18 +1967,33 @@ e_cal_backend_file_modify_object (ECalBa
 
 			/* This means its a instance generated from master object. So replace 
 			    the dates stored dates from the master object */
-			   
-			if (icaltime_compare (start, recur)) {
+			if (!recur.zone)   
+				recur.zone = start.zone;
+			
+			if (icaltime_compare_date_only (start, recur) == 0) {
 				ECalComponentDateTime m_sdate, m_endate;
 
 				e_cal_component_get_dtstart (obj_data->full_object, &m_sdate);
 				e_cal_component_get_dtend (obj_data->full_object, &m_endate);
 
+				if (icaltime_compare (start, recur) != 0) {
+					icaltimetype end = icalcomponent_get_dtend (icalcomp);
+					
+					m_sdate.value->hour = start.hour;
+					m_sdate.value->minute = start.minute;
+					m_sdate.value->second = 
+						
+					m_endate.value->hour = end.hour;
+					m_endate.value->minute = end.minute;
+					m_endate.value->second = end.second;
+				}
+
 				e_cal_component_set_dtstart (comp, &m_sdate);
 				e_cal_component_set_dtend (comp, &m_endate);
 				e_cal_component_set_recurid (comp, NULL);
 				e_cal_component_commit_sequence (comp);
-			}
+			} 
+			e_cal_component_set_recurid (comp, NULL);
 			*new_object = e_cal_component_get_as_string (comp);
 		}
 		
