rem:    if (!aCalendar) { if ("ltnSelectedCalendar" in window) { aCalendar = ltnSelectedCalendar(); } else { aCalendar = getSelectedCalendarOrNull(); } } 
add: aCalendar = aCalendar || getSelectedCalendar(); 
context:     createNewEvent: function (aCalendar, aStartTime, aEndTime) {        // XXX If we're adding an item from the view, let's make sure that        // XXX the calendar in question is visible!        // XXX unify these        if (!aCalendar) {            if ("ltnSelectedCalendar" in window) {                aCalendar = ltnSelectedCalendar();            } else {                aCalendar = getSelectedCalendarOrNull();            }        }        // if we're given both times, skip the dialog        if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {            var event = createEvent();            event.startDate = aStartTime;            event.endDate = aEndTime;            var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]                                .getService(Components.interfaces.nsIStringBundleService);            var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");            event.title = props.GetStringFromName("newEvent");            setDefaultAlarmValues(event);            doTransaction('add', event, aCalendar, null, null);        } else if (aStartTime && aStartTime.isDate) {            var event = createEvent();            event.startDate = aStartTime;            setDefaultAlarmValues(event);            doTransaction('add', event, aCalendar, null, null);        } else {            createEventWithDialog(aCalendar, aStartTime, null);        }    },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/b8864004460ce22942cdc33e51e57d6af6e2fce2/calendar-views.js/buggy/calendar/base/content/calendar-views.js