From 2c95359558397db49bf2f9bc650a72cf00db9536 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Mon, 15 Jul 2002 11:44:42 +0000 Subject: [PATCH] Forgot to initialize the arg to false, and th js code needs to finsih PP in the catch if an error is passed back. Bug 157129 r=carlen sr=waterson a=asa --- embedding/components/printingui/src/mac/nsPrintProgress.cpp | 4 +++- .../printingui/src/mac/nsPrintingPromptServiceX.cpp | 2 ++ xpfe/browser/resources/content/browser.js | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/embedding/components/printingui/src/mac/nsPrintProgress.cpp b/embedding/components/printingui/src/mac/nsPrintProgress.cpp index 32faa23aff8c..5d0f6829b300 100644 --- a/embedding/components/printingui/src/mac/nsPrintProgress.cpp +++ b/embedding/components/printingui/src/mac/nsPrintProgress.cpp @@ -76,7 +76,6 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsIDOMWindowInternal *parent, nsIObserver *openDialogObserver, PRBool *notifyOnOpen) { - *notifyOnOpen = PR_TRUE; m_observer = openDialogObserver; nsresult rv = NS_ERROR_FAILURE; @@ -111,6 +110,9 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsIDOMWindowInternal *parent, NS_LITERAL_STRING("_blank"), NS_LITERAL_STRING("chrome,titlebar,dependent,centerscreen"), array, getter_AddRefs(newWindow)); + if (NS_SUCCEEDED(rv)) { + *notifyOnOpen = PR_TRUE; + } } return rv; diff --git a/embedding/components/printingui/src/mac/nsPrintingPromptServiceX.cpp b/embedding/components/printingui/src/mac/nsPrintingPromptServiceX.cpp index 80d6c90153bf..8e3f934e2c24 100644 --- a/embedding/components/printingui/src/mac/nsPrintingPromptServiceX.cpp +++ b/embedding/components/printingui/src/mac/nsPrintingPromptServiceX.cpp @@ -278,6 +278,8 @@ nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent, NS_ENSURE_ARG(printProgressParams); NS_ENSURE_ARG(notifyOnOpen); + *notifyOnOpen = PR_FALSE; + // If running on OS X, the printing manager displays a nice progress dialog // so we don't need to do this. Keeping this code here in order to support // running TARGET_CARBON builds on OS 9. diff --git a/xpfe/browser/resources/content/browser.js b/xpfe/browser/resources/content/browser.js index f072c3975de6..a03f3b471f94 100644 --- a/xpfe/browser/resources/content/browser.js +++ b/xpfe/browser/resources/content/browser.js @@ -267,7 +267,9 @@ function BrowserPrintPreview() if (!notifyOnOpen.value.valueOf() || gWebProgress.value == null) { FinishPrintPreview(); } - } catch (e) {} + } catch (e) { + FinishPrintPreview(); + } } }