diff --git a/mozilla/calendar/base/public/calIItemBase.idl b/mozilla/calendar/base/public/calIItemBase.idl index c2f636aabbc..2030deda0af 100644 --- a/mozilla/calendar/base/public/calIItemBase.idl +++ b/mozilla/calendar/base/public/calIItemBase.idl @@ -116,7 +116,7 @@ interface calIItemBase : nsISupports // an icalComponent for this item, suitable for serialization. // the icalComponent returned is not live: changes in it or this // item will not be reflected in the other. - readonly attribute calIIcalComponent icalComponent; + attribute calIIcalComponent icalComponent; // // alarms diff --git a/mozilla/calendar/base/src/calEvent.js b/mozilla/calendar/base/src/calEvent.js index 768108ceb48..f0f00c1d9ce 100644 --- a/mozilla/calendar/base/src/calEvent.js +++ b/mozilla/calendar/base/src/calEvent.js @@ -67,27 +67,7 @@ calEvent.prototype = { { cal: "mStampDate", ics: "stampTime" } ], set icalString(value) { - if (this.mImmutable) - throw Components.results.NS_ERROR_FAILURE; - var event = icalFromString(value); - if (event.componentType != "VEVENT"); { - event = event.getFirstSubcomponent("VEVENT"); - if (!event) - - throw Components.results.NS_ERROR_INVALID_ARG; - } - - this.setItemBaseFromICS(event); - this.mapPropsFromICS(event, this.icsEventPropMap); - this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; - - var promotedProps = { - "DTSTART": true, - "DTEND": true, - "DTSTAMP": true, - __proto__: this.itemBasePromotedProps - }; - this.importUnpromotedProperties(event, promotedProps); + this.icalComponent = icalFromString(value); }, get icalString() { @@ -123,4 +103,27 @@ calEvent.prototype = { } return icalcomp; }, + + set icalComponent(event) { + if (this.mImmutable) + throw Components.results.NS_ERROR_FAILURE; + if (event.componentType != "VEVENT"); { + event = event.getFirstSubcomponent("VEVENT"); + if (!event) + + throw Components.results.NS_ERROR_INVALID_ARG; + } + + this.setItemBaseFromICS(event); + this.mapPropsFromICS(event, this.icsEventPropMap); + this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; + + var promotedProps = { + "DTSTART": true, + "DTEND": true, + "DTSTAMP": true, + __proto__: this.itemBasePromotedProps + }; + this.importUnpromotedProperties(event, promotedProps); + } }; diff --git a/mozilla/calendar/base/src/calEvent.js.pre b/mozilla/calendar/base/src/calEvent.js.pre index ad3120f576d..f4f9510e2ff 100644 --- a/mozilla/calendar/base/src/calEvent.js.pre +++ b/mozilla/calendar/base/src/calEvent.js.pre @@ -112,27 +112,7 @@ calEvent.prototype = { { cal: "mStampDate", ics: "stampTime" } ], set icalString(value) { - if (this.mImmutable) - throw Components.results.NS_ERROR_FAILURE; - var event = icalFromString(value); - if (event.componentType != "VEVENT"); { - event = event.getFirstSubcomponent("VEVENT"); - if (!event) - // throw Components.results.NS_ERROR_CALENDAR_WRONG_COMPONENT_TYPE; - throw Components.results.NS_ERROR_INVALID_ARG; - } - - this.setItemBaseFromICS(event); - this.mapPropsFromICS(event, this.icsEventPropMap); - this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; - - var promotedProps = { - "DTSTART": true, - "DTEND": true, - "DTSTAMP": true, - __proto__: this.itemBasePromotedProps - }; - this.importUnpromotedProperties(event, promotedProps); + this.icalComponent = icalFromString(value); }, get icalString() { @@ -168,4 +148,27 @@ calEvent.prototype = { } return icalcomp; }, + + set icalComponent(event) { + if (this.mImmutable) + throw Components.results.NS_ERROR_FAILURE; + if (event.componentType != "VEVENT"); { + event = event.getFirstSubcomponent("VEVENT"); + if (!event) + // throw Components.results.NS_ERROR_CALENDAR_WRONG_COMPONENT_TYPE; + throw Components.results.NS_ERROR_INVALID_ARG; + } + + this.setItemBaseFromICS(event); + this.mapPropsFromICS(event, this.icsEventPropMap); + this.mIsAllDay = this.mStartDate && this.mStartDate.isDate; + + var promotedProps = { + "DTSTART": true, + "DTEND": true, + "DTSTAMP": true, + __proto__: this.itemBasePromotedProps + }; + this.importUnpromotedProperties(event, promotedProps); + } };