Disable XUL progress dialog and fix print progress listener. b=168510 r=rods@netscape.com sr=rpotts@netscape.com

This commit is contained in:
locka%iol.ie 2002-11-06 12:14:59 +00:00
parent 6a8aae7f71
commit 494355d131

View File

@ -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<nsIWebProgressListener> printListener = do_QueryInterface(listener);
browserAsPrint->Print(printSettings, nsnull);
browserAsPrint->Print(printSettings, printListener);
listener->WaitForComplete();
if (printSettings)
@ -3341,7 +3344,9 @@ 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) {
if (aStateFlags & nsIWebProgressListener::STATE_STOP &&
aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
{
mComplete = PR_TRUE;
}
return NS_OK;