mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 407080: Disallow print-preview if page is loading. r+sr=roc, a=blocking1.9+
This commit is contained in:
parent
3a3a575e03
commit
28710c609c
@ -729,6 +729,20 @@ nsPrintEngine::PrintPreview(nsIPrintSettings* aPrintSettings,
|
||||
nsIDOMWindow *aChildDOMWin,
|
||||
nsIWebProgressListener* aWebProgressListener)
|
||||
{
|
||||
// Get the DocShell and see if it is busy
|
||||
// (We can't Print Preview this document if it is still busy)
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mContainer));
|
||||
NS_ASSERTION(docShell, "This has to be a docshell");
|
||||
|
||||
PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
|
||||
if (NS_FAILED(docShell->GetBusyFlags(&busyFlags)) ||
|
||||
busyFlags != nsIDocShell::BUSY_FLAGS_NONE) {
|
||||
CloseProgressDialog(aWebProgressListener);
|
||||
ShowPrintErrorDialog(NS_ERROR_GFX_PRINTER_DOC_IS_BUSY_PP, PR_FALSE);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Document is not busy -- go ahead with the Print Preview
|
||||
return CommonPrint(PR_TRUE, aPrintSettings, aWebProgressListener);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user