rem: var props = sbs.createBundle("chrome: document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); 
add:  if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); 
context: function refreshHtml(){    var settings = getDialogSettings();    // I'd like to use calGetString, but it can't do "formatStringFromName".    var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]                        .getService(Components.interfaces.nsIStringBundleService);    var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");    document.title = props.formatStringFromName("PrintPreviewWindowTitle",                                                [settings.title], 1);    var printformatter = Components.classes[settings.layoutCId]                                   .createInstance(Components.interfaces.calIPrintFormatter);    // Fail-safe check to not init twice, to prevent leaking files    if (gTempFile) {        gTempFile.remove(false);    }    const nsIFile = Components.interfaces.nsIFile;    var dirService = Components.classes["@mozilla.org/file/directory_service;1"]                               .getService(Components.interfaces.nsIProperties);    gTempFile = dirService.get("TmpD", nsIFile);    gTempFile.append("calendarPrint.html");    gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw-------    var ioService = Components.classes["@mozilla.org/network/io-service;1"]                              .getService(Components.interfaces.nsIIOService);    var tempUri = ioService.newFileURI(gTempFile);     var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]                           .createInstance(Components.interfaces.nsIFileOutputStream);    try {        // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY        // 0600 = -rw-------        stream.init(gTempFile, 0x2A, 0600, 0);        printformatter.formatToHtml(stream, settings.start, settings.end,                                    settings.eventList.length,                                    settings.eventList, settings.title);        stream.close();    } catch (e) {        dump("printDialog::refreshHtml:"+e+"\n");    }    document.getElementById("content").contentWindow.location = tempUri.spec;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/271f95870f5ef8d0ee5ac0f08273b214243ab951/printDialog.js/clean/calendar/resources/content/printDialog.js