From e25ba4e68de8bbcb9bdc5213be61abca398de57c Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 3 Oct 2001 23:28:38 +0000 Subject: [PATCH] Check for failure after printing the next page. If it fails then pass back PR_TRUE to indicate we are done printing this document. Bug 101597 r=kmcclusk sr=attinasi a=pdt git-svn-id: svn://10.0.0.236/trunk@104557 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocumentViewer.cpp | 7 ++++++- mozilla/layout/base/nsDocumentViewer.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 1c57cd6d9eb..ee1250c507e 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -2263,7 +2263,12 @@ DocumentViewerImpl::PrintPage(nsIPresContext* aPresContext, } // Print the Page - mPageSeqFrame->PrintNextPage(aPresContext, aPrintOptions); + // if a print job was cancelled externally, an EndPage or BeginPage may + // fail and the failure is passed back here. + // Returning PR_TRUE means we are done printing. + if (NS_FAILED(mPageSeqFrame->PrintNextPage(aPresContext, aPrintOptions))) { + return PR_TRUE; + } // Now see if any of the SubDocs are on this page if (aPO->mPrintAsIs) { diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 1c57cd6d9eb..ee1250c507e 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -2263,7 +2263,12 @@ DocumentViewerImpl::PrintPage(nsIPresContext* aPresContext, } // Print the Page - mPageSeqFrame->PrintNextPage(aPresContext, aPrintOptions); + // if a print job was cancelled externally, an EndPage or BeginPage may + // fail and the failure is passed back here. + // Returning PR_TRUE means we are done printing. + if (NS_FAILED(mPageSeqFrame->PrintNextPage(aPresContext, aPrintOptions))) { + return PR_TRUE; + } // Now see if any of the SubDocs are on this page if (aPO->mPrintAsIs) {