зеркало из https://github.com/mozilla/gecko-dev.git
Bug 301560, print() from modal dialog crashes browser [@ nsPrintEngine::ShowPrintProgress], r+sr=bz, a=blocking1.9+
This commit is contained in:
Родитель
1482c03244
Коммит
eddad205bb
|
@ -139,6 +139,7 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
|
|||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIFrameDebug.h"
|
||||
|
@ -971,6 +972,21 @@ nsPrintEngine::ShowPrintProgress(PRBool aIsForPrinting, PRBool& aDoNotify)
|
|||
nsPIDOMWindow *domWin = mDocument->GetWindow();
|
||||
if (!domWin) return;
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellItem =
|
||||
do_QueryInterface(domWin->GetDocShell());
|
||||
if (!docShellItem) return;
|
||||
nsCOMPtr<nsIDocShellTreeOwner> owner;
|
||||
docShellItem->GetTreeOwner(getter_AddRefs(owner));
|
||||
nsCOMPtr<nsIWebBrowserChrome> browserChrome = do_GetInterface(owner);
|
||||
if (!browserChrome) return;
|
||||
PRBool isModal = PR_TRUE;
|
||||
browserChrome->IsWindowModal(&isModal);
|
||||
if (isModal) {
|
||||
// Showing a print progress dialog when printing a modal window
|
||||
// isn't supported. See bug 301560.
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWebProgressListener> printProgressListener;
|
||||
|
||||
nsCOMPtr<nsIWebBrowserPrint> wbp(do_QueryInterface(mDocViewerPrint));
|
||||
|
|
Загрузка…
Ссылка в новой задаче