rem: onOperationComplete: function (aCalendar, aStatus, aOperationType, aId, aDateTime) { printInitWindow(listener.mEventArray, start, end); }, 
add: onGetResult: function (aCalendar, aStatus, aItemType, aDetail, aCount, aItems) { for (var i = 0; i < aCount; i++) { listener.mEventArray.push(aItems[i]); } } }; 
context: function printCalendar() {  var ccalendar = getDisplayComposite();  var start;  var end;  var eventList;  var listener = {    mEventArray: new Array(),    onOperationComplete: function (aCalendar, aStatus, aOperationType, aId, aDateTime) {      printInitWindow(listener.mEventArray, start, end);     },    onGetResult: function (aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {      for (var i = 0; i < aCount; i++) {        listener.mEventArray.push(aItems[i]);      }    }  };  var filter = ccalendar.ITEM_FILTER_TYPE_EVENT |                ccalendar.ITEM_FILTER_CLASS_OCCURRENCES;    var start;    var end;    switch (document.getElementById("view-field").selectedItem.value) {        case 'currentview':        case '': //just in case            start = window.opener.document.getElementById("view-deck").selectedPanel.startDay;            end   = window.opener.document.getElementById("view-deck").selectedPanel.endDay;            break;        case 'selected' :            eventList = gCalendarWindow.EventSelection.selectedEvents;            break;        case 'custom' :            start = jsDateToDateTime(document.getElementById("start-date-picker").value);            end   = jsDateToDateTime(document.getElementById("end-date-picker").value);            break ;        default :            dump("Error : no case in printDialog.js::printCalendar()");    }    if (!eventList) {        // end isn't exclusive, so we need to add one day        end = end.clone();        end.day = end.day + 1;        end.normalize();        ccalendar.getItems(filter, 0, start, end, listener);    } else {        printInitWindow(eventList, null, null);    }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/3b6286fcaa2aa5d71c302da81d9f276bc06e859b/printDialog.js/buggy/calendar/resources/content/printDialog.js