Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 8380)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-01-18 Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #476640
+
+	* backends/file/e-cal-backend-file.c:
+	(e_cal_backend_file_receive_objects):
+	Report old object properly and be sure we remove it.
+
 2008-01-07  P Chenthill <pchenthill@novell.com>
 
 	Reverting the fix for bug #503574.
Index: calendar/backends/file/e-cal-backend-file.c
===================================================================
--- calendar/backends/file/e-cal-backend-file.c	(revision 8380)
+++ calendar/backends/file/e-cal-backend-file.c	(working copy)
@@ -2550,18 +2550,20 @@
 			goto error;
 			break;
 		case ICAL_METHOD_CANCEL:
+			/* call of cancel_received_object can erase obj_data, so find old object before that */
+			obj_data = g_hash_table_lookup (priv->comp_uid_hash, uid);
+			if (obj_data)
+				old_object = e_cal_component_get_as_string (obj_data->full_object);
+			else
+				old_object = NULL;
+
 			if (cancel_received_object (cbfile, subcomp)) {
 				ECalComponentId *id;
-				object = (char *) icalcomponent_as_ical_string (subcomp);
-				obj_data = g_hash_table_lookup (priv->comp_uid_hash, uid);
-				if (obj_data)
-					old_object = e_cal_component_get_as_string (obj_data->full_object);
-				else
-					old_object = NULL;
 
 				id = e_cal_component_get_id (comp);
 
-				e_cal_backend_notify_object_removed (E_CAL_BACKEND (backend), id, old_object, object);
+				/* do not pass here the "new" object, because this was a remove of whole object */
+				e_cal_backend_notify_object_removed (E_CAL_BACKEND (backend), id, old_object, NULL);
 
 				/* remove the component from the toplevel VCALENDAR */
 				icalcomponent_remove_component (toplevel_comp, subcomp);
