From da6f0e24d34fd67493fdf3226a39cd156f872848 Mon Sep 17 00:00:00 2001 From: "bernd.mielke%snafu.de" Date: Sat, 6 Oct 2001 14:07:28 +0000 Subject: [PATCH] Don't start printing when regression test are executed bug 99633 r=rods sr=attinasi --- content/base/src/nsDocumentViewer.cpp | 5 +++-- layout/base/nsDocumentViewer.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/content/base/src/nsDocumentViewer.cpp b/content/base/src/nsDocumentViewer.cpp index ee1250c507ea..7ba06838db86 100644 --- a/content/base/src/nsDocumentViewer.cpp +++ b/content/base/src/nsDocumentViewer.cpp @@ -2126,7 +2126,7 @@ PRBool DocumentViewerImpl::DonePrintingPages(PrintObject* aPO) { //NS_ASSERTION(aPO, "Pointer is null!"); - PRINT_DEBUG_MSG3("****** In DV::DonePrintingPages PO: %p (%s)\n", aPO, gFrameTypesStr[aPO->mFrameType]); + PRINT_DEBUG_MSG3("****** In DV::DonePrintingPages PO: %p (%s)\n", aPO, aPO?gFrameTypesStr[aPO->mFrameType]:""); if (aPO != nsnull) { aPO->mHasBeenPrinted = PR_TRUE; @@ -3278,7 +3278,8 @@ DocumentViewerImpl::SetupToPrintContent(nsIWebShell* aParent, // BeginDocument may pass back a FAILURE code // i.e. On Windows, if you are printing to a file and hit "Cancel" // to the "File Name" dialog, this comes back as an error - nsresult rv = mPrt->mPrintDC->BeginDocument(docTitleStr); + // Don't start printing when regression test are executed + nsresult rv = mPrt->mFilePointer ? NS_OK: mPrt->mPrintDC->BeginDocument(docTitleStr); PRINT_DEBUG_MSG1("****************** Begin Document ************************\n"); if (docTitleStr != nsnull) { diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index ee1250c507ea..7ba06838db86 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2126,7 +2126,7 @@ PRBool DocumentViewerImpl::DonePrintingPages(PrintObject* aPO) { //NS_ASSERTION(aPO, "Pointer is null!"); - PRINT_DEBUG_MSG3("****** In DV::DonePrintingPages PO: %p (%s)\n", aPO, gFrameTypesStr[aPO->mFrameType]); + PRINT_DEBUG_MSG3("****** In DV::DonePrintingPages PO: %p (%s)\n", aPO, aPO?gFrameTypesStr[aPO->mFrameType]:""); if (aPO != nsnull) { aPO->mHasBeenPrinted = PR_TRUE; @@ -3278,7 +3278,8 @@ DocumentViewerImpl::SetupToPrintContent(nsIWebShell* aParent, // BeginDocument may pass back a FAILURE code // i.e. On Windows, if you are printing to a file and hit "Cancel" // to the "File Name" dialog, this comes back as an error - nsresult rv = mPrt->mPrintDC->BeginDocument(docTitleStr); + // Don't start printing when regression test are executed + nsresult rv = mPrt->mFilePointer ? NS_OK: mPrt->mPrintDC->BeginDocument(docTitleStr); PRINT_DEBUG_MSG1("****************** Begin Document ************************\n"); if (docTitleStr != nsnull) {