From ea43271139d02b4589aa4e02baa1dd39cff7da7c Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Tue, 9 Apr 2002 14:17:56 +0000 Subject: [PATCH] Although the front-end should be disabled and not allow the user to make any changes to PP while the document is printing. This samll fix is back-end insurance to keep a crash from happening. Bug 130691 r=kin sr=attinas a=rjesup adt=jaime git-svn-id: svn://10.0.0.236/trunk@118546 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocumentViewer.cpp | 6 ++++++ mozilla/layout/base/nsDocumentViewer.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 7920a0106f0..4819b45f42c 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -5248,6 +5248,8 @@ NS_IMETHODIMP DocumentViewerImpl::PrintPreviewNavigate(PRInt16 aType, PRInt32 aPageNum) { #ifdef NS_PRINT_PREVIEW + if (mIsDoingPrinting) return NS_ERROR_FAILURE; + if (!mPrtPreview) return NS_ERROR_FAILURE; nsIScrollableView* scrollableView; @@ -5426,6 +5428,8 @@ DocumentViewerImpl::GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages) NS_IMETHODIMP DocumentViewerImpl::ExitPrintPreview() { + if (mIsDoingPrinting) return NS_ERROR_FAILURE; + if (mIsDoingPrintPreview) { ReturnToGalleyPresentation(); } @@ -5835,6 +5839,8 @@ DocumentViewerImpl::CheckDocumentForPPCaching() NS_IMETHODIMP DocumentViewerImpl::PrintPreview(nsIPrintSettings* aPrintSettings) { + if (mIsDoingPrinting) return NS_ERROR_FAILURE; + // Get the webshell for this documentviewer nsCOMPtr webContainer(do_QueryInterface(mContainer)); // Get the DocShell and see if it is busy diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 7920a0106f0..4819b45f42c 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -5248,6 +5248,8 @@ NS_IMETHODIMP DocumentViewerImpl::PrintPreviewNavigate(PRInt16 aType, PRInt32 aPageNum) { #ifdef NS_PRINT_PREVIEW + if (mIsDoingPrinting) return NS_ERROR_FAILURE; + if (!mPrtPreview) return NS_ERROR_FAILURE; nsIScrollableView* scrollableView; @@ -5426,6 +5428,8 @@ DocumentViewerImpl::GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages) NS_IMETHODIMP DocumentViewerImpl::ExitPrintPreview() { + if (mIsDoingPrinting) return NS_ERROR_FAILURE; + if (mIsDoingPrintPreview) { ReturnToGalleyPresentation(); } @@ -5835,6 +5839,8 @@ DocumentViewerImpl::CheckDocumentForPPCaching() NS_IMETHODIMP DocumentViewerImpl::PrintPreview(nsIPrintSettings* aPrintSettings) { + if (mIsDoingPrinting) return NS_ERROR_FAILURE; + // Get the webshell for this documentviewer nsCOMPtr webContainer(do_QueryInterface(mContainer)); // Get the DocShell and see if it is busy