Backing out bug 429337 to fix broken printing reftests on linux test box.

This commit is contained in:
dholbert@cs.stanford.edu 2008-04-21 17:48:12 -07:00
parent aff5af5763
commit 80266fc62d
2 changed files with 14 additions and 6 deletions

View File

@ -235,12 +235,6 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
nsSize pageSize = aPresContext->GetPageSize();
mPageData->mReflowSize = pageSize;
// If we're printing a selection, we need to reflow with
// unconstrained height, to make sure we'll get to the selection
// even if it's beyond the first page of content.
if (nsIPrintSettings::kRangeSelection == mPrintRangeType) {
mPageData->mReflowSize.height = NS_UNCONSTRAINEDSIZE;
}
mPageData->mReflowMargin = mMargin;
// Compute the size of each page and the x coordinate that each page will

View File

@ -1897,6 +1897,20 @@ nsPrintEngine::ReflowPrintObject(nsPrintObject * aPO)
PR_PL(("In DV::ReflowPrintObject PO: %p (%9s) Setting w,h to %d,%d\n", aPO,
gFrameTypesStr[aPO->mFrameType], adjSize.width, adjSize.height));
// XXX - Hack Alert
// OK, so there is a selection, we will print the entire selection
// on one page and then crop the page.
// This means you can never print any selection that is longer than
// one page, but it keeps it from page breaking in the middle of your
// print of the selection (see also nsSimplePageSequence.cpp)
PRInt16 printRangeType = nsIPrintSettings::kRangeAllPages;
mPrt->mPrintSettings->GetPrintRange(&printRangeType);
if (printRangeType == nsIPrintSettings::kRangeSelection &&
IsThereARangeSelection(mPrt->mCurrentFocusWin)) {
adjSize.height = NS_UNCONSTRAINEDSIZE;
}
// Here we decide whether we need scrollbars and
// what the parent will be of the widget
// How this logic presently works: Print Preview is always as-is (as far