Bug 1274079, ensure that after dispatching beforeprint, we have still valid ContentViewer to print, r=bz

--HG--
extra : rebase_source : c07cf7794d48d4f9b52b2646c18099a33bbea788
This commit is contained in:
Olli Pettay 2016-08-02 21:41:51 +03:00
Родитель 86f360cd93
Коммит c8587c2d07
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -3728,6 +3728,9 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
nsAutoPtr<nsPrintEventDispatcher> beforeAndAfterPrint(
new nsPrintEventDispatcher(doc));
NS_ENSURE_STATE(!GetIsPrinting());
// beforeprint event may have caused ContentViewer to be shutdown.
NS_ENSURE_STATE(mContainer);
NS_ENSURE_STATE(mDeviceContext);
if (!mPrintEngine) {
mPrintEngine = new nsPrintEngine();