From 35e6989ef90a69f881a1126f4f75216e3ac8d0ca Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Tue, 30 Jul 2002 19:27:05 +0000 Subject: [PATCH] #107484 r=pete, sr=bzbarsky, a=asa Fix regression printing on OS/2 - don't do localfile stuff unless we are printing to file --- xpfe/global/resources/content/printdialog.js | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/xpfe/global/resources/content/printdialog.js b/xpfe/global/resources/content/printdialog.js index 5d08a90818d..8060af505b0 100644 --- a/xpfe/global/resources/content/printdialog.js +++ b/xpfe/global/resources/content/printdialog.js @@ -398,17 +398,20 @@ function onAccept() gPrintSettings.toFileName = dialog.fileInput.value; gPrintSettings.printerName = dialog.printerList.value; - var sfile = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); - sfile.initWithPath(gPrintSettings.toFileName); - if (sfile.exists() && - gPrintSettings.printToFile && - gPrintSettings.toFileName != gFileFromPicker) { - var desc = stringBundle.formatStringFromName("fileConfirm.exists", - [gPrintSettings.toFileName], - 1); - if (!promptService.confirm(this.window, null, desc)) { + if (gPrintSettings.printToFile) { + if (gPrintSettings.toFileName == "") return false; + var sfile = Components.classes["@mozilla.org/file/local;1"] + .createInstance(Components.interfaces.nsILocalFile); + sfile.initWithPath(gPrintSettings.toFileName); + if (sfile.exists() && + gPrintSettings.toFileName != gFileFromPicker) { + var desc = stringBundle.formatStringFromName("fileConfirm.exists", + [gPrintSettings.toFileName], + 1); + if (!promptService.confirm(this.window, null, desc)) { + return false; + } } }