Bug 348500 error when press cancel in dialog 'Editing a repeating item' for recurrence event, patch by ssitter, r1=lilmatt, r2=jminta

This commit is contained in:
jminta%gmail.com 2006-08-14 17:02:05 +00:00
parent e5981b9e2d
commit 3a7e5a014c
2 changed files with 7 additions and 0 deletions

View File

@ -180,6 +180,7 @@ function openEventDialog(calendarItem, calendar, mode, callback)
// whether the user wants to edit all instances, or just this one. This
// function prompts this question (if the item is actually an instance of a
// recurring event) and returns the appropriate item that should be modified.
// Returns null if the prompt was cancelled.
function getOccurrenceOrParent(occurrence) {
// Check if this actually is an instance of a recurring event
if (occurrence == occurrence.parentItem) {

View File

@ -94,6 +94,9 @@ var calendarViewController = {
var itemToEdit;
if (aNewStartTime && aNewEndTime) {
itemToEdit = getOccurrenceOrParent(aOccurrence);
if (!itemToEdit) {
return;
}
var instance = itemToEdit.clone();
// if we're about to modify the parentItem, we need to account
@ -143,6 +146,9 @@ var calendarViewController = {
deleteOccurrence: function (aOccurrence) {
var itemToDelete = getOccurrenceOrParent(aOccurrence);
if (!itemToDelete) {
return;
}
if (!itemToDelete.parentItem.hasSameIds(itemToDelete)) {
var event = itemToDelete.parentItem.clone();
event.recurrenceInfo.removeOccurrenceAt(itemToDelete.recurrenceId);