From 726521361541f42f636bf859528ba0093d1e93b3 Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Wed, 7 Nov 2001 02:38:49 +0000 Subject: [PATCH] bug 105166 - additional patch to place rounding code in the right place. sr=attinasi. git-svn-id: svn://10.0.0.236/trunk@107535 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/nsTableOuterFrame.cpp | 17 ++++++++--------- mozilla/layout/tables/nsTableOuterFrame.cpp | 17 ++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 982973d298d..171a4250761 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -938,6 +938,14 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext, if (aAvailWidth) { availWidth = *aAvailWidth; } + // work around pixel rounding errors, round down to ensure we don't exceed the avail height in + float p2t; + aPresContext->GetScaledPixelsToTwips(&p2t); + nscoord availHeight = aOuterRS.availableHeight; + if (NS_UNCONSTRAINEDSIZE != availHeight) { + availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown); + } + nsHTMLReflowState childRS(aPresContext, aOuterRS, aChildFrame, nsSize(availWidth, aOuterRS.availableHeight)); childRS.reason = aReflowReason; @@ -1469,15 +1477,6 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext, nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aOuterRS); #endif - float p2t; - aPresContext->GetScaledPixelsToTwips(&p2t); - - // work around pixel rounding errors, round down to ensure we don't exceed the avail height in - nscoord availHeight = aOuterRS.availableHeight; - if (NS_UNCONSTRAINEDSIZE != availHeight) { - availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown); - } - nsresult rv = NS_OK; PRUint8 captionSide = GetCaptionSide(); diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 982973d298d..171a4250761 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -938,6 +938,14 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext, if (aAvailWidth) { availWidth = *aAvailWidth; } + // work around pixel rounding errors, round down to ensure we don't exceed the avail height in + float p2t; + aPresContext->GetScaledPixelsToTwips(&p2t); + nscoord availHeight = aOuterRS.availableHeight; + if (NS_UNCONSTRAINEDSIZE != availHeight) { + availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown); + } + nsHTMLReflowState childRS(aPresContext, aOuterRS, aChildFrame, nsSize(availWidth, aOuterRS.availableHeight)); childRS.reason = aReflowReason; @@ -1469,15 +1477,6 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext, nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aOuterRS); #endif - float p2t; - aPresContext->GetScaledPixelsToTwips(&p2t); - - // work around pixel rounding errors, round down to ensure we don't exceed the avail height in - nscoord availHeight = aOuterRS.availableHeight; - if (NS_UNCONSTRAINEDSIZE != availHeight) { - availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown); - } - nsresult rv = NS_OK; PRUint8 captionSide = GetCaptionSide();