From e90d1903ddfe30a3b3dda893931e6e8cfbdd50de Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Tue, 14 Jun 2005 21:03:06 +0000 Subject: [PATCH] don't output unset attributes to ics. bug 297530, r=vlad --- calendar/base/src/calItemBase.js | 2 +- calendar/base/src/calTodo.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/calendar/base/src/calItemBase.js b/calendar/base/src/calItemBase.js index ef4038b6af1..39ea5cad744 100644 --- a/calendar/base/src/calItemBase.js +++ b/calendar/base/src/calItemBase.js @@ -549,7 +549,7 @@ calItemBase.prototype = { for (var i = 0; i < this.mAttendees.length; i++) icalcomp.addProperty(this.mAttendees[i].icalProperty); - if (this.mGeneration != 0) { + if (this.mGeneration) { var genprop = icalProp("X-MOZILLA-GENERATION"); genprop.stringValue = String(this.mGeneration); icalcomp.addProperty(genprop); diff --git a/calendar/base/src/calTodo.js b/calendar/base/src/calTodo.js index ac3126a0c57..880bea0bfbb 100644 --- a/calendar/base/src/calTodo.js +++ b/calendar/base/src/calTodo.js @@ -104,7 +104,7 @@ calTodo.prototype = { this.mEntryDate = new CalDateTime(); this.mDueDate = new CalDateTime(); this.mCompletedDate = new CalDateTime(); - this.mPercentComplete = 0; + this.mPercentComplete = undefined; }, cloneShallow: function (aNewParent) { @@ -177,9 +177,11 @@ calTodo.prototype = { this.fillIcalComponentFromBase(icalcomp); this.mapPropsToICS(icalcomp, this.icsEventPropMap); - var percentprop = icssvc.createIcalProperty("PERCENT-COMPLETE"); - percentprop.stringValue = this.mPercentComplete; - icalcomp.addProperty(percentprop); + if (this.mPercentComplete != undefined) { + var percentprop = icssvc.createIcalProperty("PERCENT-COMPLETE"); + percentprop.stringValue = this.mPercentComplete; + icalcomp.addProperty(percentprop); + } var bagenum = this.mProperties.enumerator; while (bagenum.hasMoreElements()) {