From 494355d131cba05540eb8c7f3b496b3b8d756dca Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Wed, 6 Nov 2002 12:14:59 +0000 Subject: [PATCH] Disable XUL progress dialog and fix print progress listener. b=168510 r=rods@netscape.com sr=rpotts@netscape.com --- .../activex/src/control/MozillaBrowser.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/embedding/browser/activex/src/control/MozillaBrowser.cpp b/embedding/browser/activex/src/control/MozillaBrowser.cpp index ee03af6144b1..3e6be679b24a 100644 --- a/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -1489,9 +1489,12 @@ HRESULT CMozillaBrowser::PrintDocument(BOOL promptUser) printSettings->SetPrintSilent(promptUser ? PR_FALSE : PR_TRUE); } + // Disable print progress dialog (XUL) + mPrefs->SetBoolPref("print.show_print_progress", PR_FALSE); + PrintListener *listener = new PrintListener; nsCOMPtr printListener = do_QueryInterface(listener); - browserAsPrint->Print(printSettings, nsnull); + browserAsPrint->Print(printSettings, printListener); listener->WaitForComplete(); if (printSettings) @@ -3341,10 +3344,12 @@ void PrintListener::WaitForComplete() /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */ NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) { - if (aStatus == nsIWebProgressListener::STATE_STOP) { - mComplete = PR_TRUE; - } - return NS_OK; + if (aStateFlags & nsIWebProgressListener::STATE_STOP && + aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT) + { + mComplete = PR_TRUE; + } + return NS_OK; } /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */