From 9e8ccf48897692a48ef1259c86f9fb82b48f7d0b Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Thu, 5 Oct 2000 21:07:00 +0000 Subject: [PATCH] bug 55192 - use the strategy of the first in flow when (incorrectly) getting an incremental reflow during printing. a=buster, r=peterl --- layout/html/table/src/nsTableFrame.cpp | 9 ++++++++- layout/tables/nsTableFrame.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index 90afcbade3dd..2dc4419c94ef 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -1747,7 +1747,14 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext, // See if the pass1 maximum width is no longer valid because one of the // cell maximum widths changed - if (!IsMaximumWidthValid()) { + if (mPrevInFlow) { + // a next in flow just uses the preferred width of the 1st in flow. + nsTableFrame* firstInFlow = (nsTableFrame*)GetFirstInFlow(); + if (firstInFlow) { + aDesiredSize.mMaximumWidth = firstInFlow->GetPreferredWidth(); + } + } + else if (!IsMaximumWidthValid()) { // Initialize the strategy and have it compute the natural size of // the table mTableLayoutStrategy->Initialize(aPresContext, nsnull, NS_UNCONSTRAINEDSIZE, aReflowState); diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 90afcbade3dd..2dc4419c94ef 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1747,7 +1747,14 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext, // See if the pass1 maximum width is no longer valid because one of the // cell maximum widths changed - if (!IsMaximumWidthValid()) { + if (mPrevInFlow) { + // a next in flow just uses the preferred width of the 1st in flow. + nsTableFrame* firstInFlow = (nsTableFrame*)GetFirstInFlow(); + if (firstInFlow) { + aDesiredSize.mMaximumWidth = firstInFlow->GetPreferredWidth(); + } + } + else if (!IsMaximumWidthValid()) { // Initialize the strategy and have it compute the natural size of // the table mTableLayoutStrategy->Initialize(aPresContext, nsnull, NS_UNCONSTRAINEDSIZE, aReflowState);