From ce51183fce538d2cf5297ee91fb4f67392a293ee Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Thu, 11 Nov 2004 17:27:38 +0000 Subject: [PATCH] Split row groups works only for paginated media bug 268231 r/sr=bzbarsky --- layout/html/table/src/nsTableRowGroupFrame.cpp | 13 ++++++++++--- layout/tables/nsTableRowGroupFrame.cpp | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/layout/html/table/src/nsTableRowGroupFrame.cpp b/layout/html/table/src/nsTableRowGroupFrame.cpp index e7749e840c5b..5fa42331344b 100644 --- a/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -983,12 +983,19 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, aDesiredSize.height = 0; GET_PIXELS_TO_TWIPS(aPresContext, p2t); - nscoord availWidth = nsTableFrame::RoundToPixel(aReflowState.availableWidth, p2t); - nscoord availHeight = nsTableFrame::RoundToPixel(aReflowState.availableHeight, p2t); + nscoord availWidth = (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) ? + NS_UNCONSTRAINEDSIZE : + nsTableFrame::RoundToPixel(aReflowState.availableWidth, p2t); + nscoord availHeight = (NS_UNCONSTRAINEDSIZE == aReflowState.availableHeight) ? + NS_UNCONSTRAINEDSIZE : + nsTableFrame::RoundToPixel(aReflowState.availableHeight, p2t); PRBool borderCollapse = ((nsTableFrame*)aTableFrame->GetFirstInFlow())->IsBorderCollapse(); nscoord cellSpacingY = aTableFrame->GetCellSpacingY(); - + + NS_ASSERTION(aPresContext->IsPaginated(), "SplitRowGroup currently supports only paged media"); + if (!aPresContext->IsPaginated()) + return NS_ERROR_NOT_IMPLEMENTED; // get the page height nsRect actualRect; nsRect adjRect; diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index e7749e840c5b..5fa42331344b 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -983,12 +983,19 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, aDesiredSize.height = 0; GET_PIXELS_TO_TWIPS(aPresContext, p2t); - nscoord availWidth = nsTableFrame::RoundToPixel(aReflowState.availableWidth, p2t); - nscoord availHeight = nsTableFrame::RoundToPixel(aReflowState.availableHeight, p2t); + nscoord availWidth = (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) ? + NS_UNCONSTRAINEDSIZE : + nsTableFrame::RoundToPixel(aReflowState.availableWidth, p2t); + nscoord availHeight = (NS_UNCONSTRAINEDSIZE == aReflowState.availableHeight) ? + NS_UNCONSTRAINEDSIZE : + nsTableFrame::RoundToPixel(aReflowState.availableHeight, p2t); PRBool borderCollapse = ((nsTableFrame*)aTableFrame->GetFirstInFlow())->IsBorderCollapse(); nscoord cellSpacingY = aTableFrame->GetCellSpacingY(); - + + NS_ASSERTION(aPresContext->IsPaginated(), "SplitRowGroup currently supports only paged media"); + if (!aPresContext->IsPaginated()) + return NS_ERROR_NOT_IMPLEMENTED; // get the page height nsRect actualRect; nsRect adjRect;