Fixing some problems.

git-svn-id: svn://10.0.0.236/branches/TREEWIDGET_19990616_BRANCH@35853 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com
1999-06-18 09:02:37 +00:00
parent 370943637c
commit a738635a2d
3 changed files with 34 additions and 0 deletions

View File

@@ -4249,6 +4249,13 @@ void nsTableFrame::DistributeSpaceToRows(nsIPresContext& aPresContext,
y += excessForRow+rowRect.height;
aExcessForRowGroup += excessForRow;
}
else
{
nsRect rowRect;
rowFrame->GetRect(rowRect);
y += rowRect.height;
}
rowFrame = iter.Next();
}
nsRect rowGroupRect;
@@ -4261,6 +4268,27 @@ void nsTableFrame::DistributeSpaceToRows(nsIPresContext& aPresContext,
DistributeSpaceToCells(aPresContext, aReflowState, aRowGroupFrame);
}
NS_IMETHODIMP nsTableFrame::GetTableSpecifiedHeight(nscoord& aResult, const nsHTMLReflowState& aReflowState)
{
const nsStylePosition* tablePosition;
GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)tablePosition);
const nsStyleTable* tableStyle;
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
nscoord tableSpecifiedHeight=-1;
if (eStyleUnit_Coord == tablePosition->mHeight.GetUnit())
tableSpecifiedHeight = tablePosition->mHeight.GetCoordValue();
else if (eStyleUnit_Percent == tablePosition->mHeight.GetUnit())
{
float percent = tablePosition->mHeight.GetPercentValue();
nscoord parentHeight = GetEffectiveContainerHeight(aReflowState);
if (NS_UNCONSTRAINEDSIZE!=parentHeight && 0!=parentHeight)
tableSpecifiedHeight = NSToCoordRound((float)parentHeight * percent);
}
aResult = tableSpecifiedHeight;
return NS_OK;
}
nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nscoord aDefaultHeight)

View File

@@ -453,6 +453,9 @@ public:
nsReflowReason aReason,
PRBool aDoSiblings);
NS_IMETHOD GetTableSpecifiedHeight(nscoord& aHeight, const nsHTMLReflowState& aReflowState);
protected:
/** second pass of ResizeReflow.
* lays out all table content with aMaxSize(computed_table_width, given_table_height)

View File

@@ -1023,6 +1023,9 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
else if (tableFrame == nsnull)
return NS_ERROR_NULL_POINTER;
nscoord tableSpecifiedHeight;
tableFrame->GetTableSpecifiedHeight(tableSpecifiedHeight, aReflowState);
RowGroupReflowState state(aPresContext, aReflowState, tableFrame);
if (eReflowReason_Incremental == aReflowState.reason) {