From bf413d89a7bdb5dbb8e18d2d866ee4eafb1db9f4 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 30 May 2001 21:19:46 +0000 Subject: [PATCH] makes sure the views for the pages that are not being printed are completely hidden Bug 83138 r=kmclusk sr=attinasi a=dbaron --- layout/generic/nsSimplePageSequence.cpp | 10 +++++++--- layout/html/base/src/nsSimplePageSequence.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/layout/generic/nsSimplePageSequence.cpp b/layout/generic/nsSimplePageSequence.cpp index 96265e7eb8d6..e107d03d56e9 100644 --- a/layout/generic/nsSimplePageSequence.cpp +++ b/layout/generic/nsSimplePageSequence.cpp @@ -568,9 +568,13 @@ nsSimplePageSequenceFrame::StartPrint(nsIPresContext* aPresContext, page->GetView(aPresContext, &view); NS_ASSERTION(nsnull != view, "no page view"); if (pageNum < mFromPageNum || pageNum > mToPageNum) { - // XXX Doesn't seem like we need to do this - // because we ask only the pages we want to print - //view->SetVisibility(nsViewVisibility_kHide); + // Hide the pages that won't be printed to the Viewmanager + // doesn't put them in the display list. Also, makde + // sure the child views don't get asked to print + // but my guess is that there won't be any + view->SetVisibility(nsViewVisibility_kHide); + view->SetChildClip(0,0,0,0); + view->SetViewFlags(NS_VIEW_PUBLIC_FLAG_CLIPCHILDREN); } else { nsRect rect; page->GetRect(rect); diff --git a/layout/html/base/src/nsSimplePageSequence.cpp b/layout/html/base/src/nsSimplePageSequence.cpp index 96265e7eb8d6..e107d03d56e9 100644 --- a/layout/html/base/src/nsSimplePageSequence.cpp +++ b/layout/html/base/src/nsSimplePageSequence.cpp @@ -568,9 +568,13 @@ nsSimplePageSequenceFrame::StartPrint(nsIPresContext* aPresContext, page->GetView(aPresContext, &view); NS_ASSERTION(nsnull != view, "no page view"); if (pageNum < mFromPageNum || pageNum > mToPageNum) { - // XXX Doesn't seem like we need to do this - // because we ask only the pages we want to print - //view->SetVisibility(nsViewVisibility_kHide); + // Hide the pages that won't be printed to the Viewmanager + // doesn't put them in the display list. Also, makde + // sure the child views don't get asked to print + // but my guess is that there won't be any + view->SetVisibility(nsViewVisibility_kHide); + view->SetChildClip(0,0,0,0); + view->SetViewFlags(NS_VIEW_PUBLIC_FLAG_CLIPCHILDREN); } else { nsRect rect; page->GetRect(rect);