From 7152b0e0757cb6f048f441a4faf62aa4abff7c48 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 5 Aug 2008 01:53:01 +0000 Subject: [PATCH] Monotone-Parent: 8a9b77b9c41a41491783c3507d9b85c3555500a3 Monotone-Revision: 7b44f54acaa78763162cefc160fada0303ee1d95 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-05T01:53:01 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/Appointments/SOGoCalendarComponent.m | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6da979ca6..cbcc580aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-08-04 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent -calendar:create:secure]): we now return a + deep copy of the current calendar element, so that further + modifications do not impact the original copy. + * SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): same as below. diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index dbdffaf56..592cc7693 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -328,7 +328,7 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID) { NSString *componentTag; iCalRepeatableEntityObject *newComponent; - iCalCalendar **calendar; + iCalCalendar **calendar, *returnedCopy; NSString *iCalString; if (secure) @@ -365,7 +365,10 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID) } } - return *calendar; + returnedCopy = [*calendar mutableCopy]; + [returnedCopy autorelease]; + + return returnedCopy; } - (id) component: (BOOL) create secure: (BOOL) secure