build warning fix bug 198738 r/sr=bzbarsky

This commit is contained in:
bmlk%gmx.de 2003-04-05 15:36:31 +00:00
parent 9ce6c8be14
commit 00f2ea1ad8
10 changed files with 12 additions and 50 deletions

View File

@ -159,7 +159,7 @@ FixedTableLayoutStrategy::AssignNonPctColumnWidths(nsIPresContext* aPre
// need to add border and padding into percent width
nsMargin borderPadding = nsTableFrame::GetBorderPadding(nsSize(aReflowState.mComputedWidth, 0),
aPixelToTwips, cellFrame);
cellWidth = percent * (float)availWidth + borderPadding.left + borderPadding.right;
cellWidth = NSToCoordRound(percent * (float) availWidth) + borderPadding.left + borderPadding.right;
colWidths[colX] = nsTableFrame::RoundToPixel(NSToCoordRound(((float) cellWidth) / ((float) colSpan)),
aPixelToTwips);
colFrame->SetWidth(PCT, colWidths[colX]);

View File

@ -135,22 +135,6 @@ nsTableCellFrame::Init(nsIPresContext* aPresContext,
return rv;
}
static PRBool
NoComputedHeightBetween(const nsHTMLReflowState& aReflowState,
nsIFrame* aCellFrame)
{
for (const nsHTMLReflowState* rs = aReflowState.parentReflowState; rs; rs = rs->parentReflowState) {
if ((NS_UNCONSTRAINEDSIZE != rs->mComputedHeight) || (0 != rs->mComputedHeight)) {
return PR_FALSE;
}
// stop when we hit the cell frame
if (rs->frame == aCellFrame) {
return PR_TRUE;
}
}
NS_ASSERTION(PR_FALSE, "program error in NoComputedHeightBetween");
return PR_FALSE;
}
// nsIPercentHeightObserver methods
@ -739,6 +723,7 @@ PRInt32 nsTableCellFrame::GetColSpan()
return colSpan;
}
#ifdef DEBUG
#define PROBABLY_TOO_LARGE 1000000
static
void DebugCheckChildSize(nsIFrame* aChild,
@ -758,6 +743,7 @@ void DebugCheckChildSize(nsIFrame* aChild,
}
}
}
#endif
// the computed height for the cell, which descendents use for percent height calculations
// it is the height (minus border, padding) of the cell's first in flow during its final
@ -834,7 +820,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
/* XXX: remove tableFrame when border-collapse inherits */
nsTableFrame* tableFrame = nsnull;
rv = nsTableFrame::GetTableFrame(this, tableFrame); if (!tableFrame) ABORT1(NS_ERROR_NULL_POINTER);
nsTableFrame* tableFrameFirstInFlow = (nsTableFrame*)tableFrame->GetFirstInFlow();
nsMargin borderPadding = aReflowState.mComputedPadding;
nsMargin border;

View File

@ -487,7 +487,6 @@ NS_METHOD nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPres
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
// the col group is a target if its path has a reflow command
nsHTMLReflowCommand* command = aReflowState.path->mReflowCommand;

View File

@ -525,7 +525,7 @@ nscoord
nsTableRowFrame::CalcHeight(const nsHTMLReflowState& aReflowState)
{
nsTableFrame* tableFrame = nsnull;
nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame);
nsTableFrame::GetTableFrame(this, tableFrame);
if (!tableFrame) return 0;
nscoord computedHeight = (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight)
@ -915,7 +915,6 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
PRInt32 prevColIndex = firstPrevColIndex;
nscoord x = 0; // running total of children x offset
nsTableFrame* tableFirstInFlow = (nsTableFrame*)aTableFrame.GetFirstInFlow();
PRBool isAutoLayout = aTableFrame.IsAutoLayout();
PRBool needToNotifyTable = PR_TRUE;
nscoord paginatedHeight = 0;
@ -1276,7 +1275,6 @@ nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
// At this point, we know the column widths. Compute the cell available width
PRInt32 cellColIndex;
cellFrame->GetColIndex(cellColIndex);
PRInt32 cellColSpan = aTableFrame.GetEffectiveColSpan(*cellFrame);
nscoord cellSpacingX = aTableFrame.GetCellSpacingX();
nscoord colAvailWidth, cellAvailWidth;

View File

@ -674,7 +674,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext,
rowInfo[rowIndex].pctHeight = nsTableFrame::RoundToPixel(rowFrame->GetHeight(pctHeightBasis), p2t);
}
rowInfo[rowIndex].hasStyleHeight = rowFrame->HasStyleHeight();
nonPctHeight = PR_MAX(nonPctHeight, rowFrame->GetFixedHeight());
nonPctHeight = nsTableFrame::RoundToPixel(PR_MAX(nonPctHeight, rowFrame->GetFixedHeight()), p2t);
}
UpdateHeights(rowInfo[rowIndex], nonPctHeight, heightOfRows, heightOfUnStyledRows);
@ -1088,8 +1088,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsIPresContext* aPresContext,
GET_PIXELS_TO_TWIPS(aPresContext, p2t);
nscoord availWidth = nsTableFrame::RoundToPixel(aReflowState.availableWidth, p2t);
nscoord availHeight = nsTableFrame::RoundToPixel(aReflowState.availableHeight, p2t);
nscoord origAvailHeight = availHeight;
PRBool borderCollapse = ((nsTableFrame*)aTableFrame->GetFirstInFlow())->IsBorderCollapse();
nscoord cellSpacingY = aTableFrame->GetCellSpacingY();

View File

@ -159,7 +159,7 @@ FixedTableLayoutStrategy::AssignNonPctColumnWidths(nsIPresContext* aPre
// need to add border and padding into percent width
nsMargin borderPadding = nsTableFrame::GetBorderPadding(nsSize(aReflowState.mComputedWidth, 0),
aPixelToTwips, cellFrame);
cellWidth = percent * (float)availWidth + borderPadding.left + borderPadding.right;
cellWidth = NSToCoordRound(percent * (float) availWidth) + borderPadding.left + borderPadding.right;
colWidths[colX] = nsTableFrame::RoundToPixel(NSToCoordRound(((float) cellWidth) / ((float) colSpan)),
aPixelToTwips);
colFrame->SetWidth(PCT, colWidths[colX]);

View File

@ -135,22 +135,6 @@ nsTableCellFrame::Init(nsIPresContext* aPresContext,
return rv;
}
static PRBool
NoComputedHeightBetween(const nsHTMLReflowState& aReflowState,
nsIFrame* aCellFrame)
{
for (const nsHTMLReflowState* rs = aReflowState.parentReflowState; rs; rs = rs->parentReflowState) {
if ((NS_UNCONSTRAINEDSIZE != rs->mComputedHeight) || (0 != rs->mComputedHeight)) {
return PR_FALSE;
}
// stop when we hit the cell frame
if (rs->frame == aCellFrame) {
return PR_TRUE;
}
}
NS_ASSERTION(PR_FALSE, "program error in NoComputedHeightBetween");
return PR_FALSE;
}
// nsIPercentHeightObserver methods
@ -739,6 +723,7 @@ PRInt32 nsTableCellFrame::GetColSpan()
return colSpan;
}
#ifdef DEBUG
#define PROBABLY_TOO_LARGE 1000000
static
void DebugCheckChildSize(nsIFrame* aChild,
@ -758,6 +743,7 @@ void DebugCheckChildSize(nsIFrame* aChild,
}
}
}
#endif
// the computed height for the cell, which descendents use for percent height calculations
// it is the height (minus border, padding) of the cell's first in flow during its final
@ -834,7 +820,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
/* XXX: remove tableFrame when border-collapse inherits */
nsTableFrame* tableFrame = nsnull;
rv = nsTableFrame::GetTableFrame(this, tableFrame); if (!tableFrame) ABORT1(NS_ERROR_NULL_POINTER);
nsTableFrame* tableFrameFirstInFlow = (nsTableFrame*)tableFrame->GetFirstInFlow();
nsMargin borderPadding = aReflowState.mComputedPadding;
nsMargin border;

View File

@ -487,7 +487,6 @@ NS_METHOD nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPres
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsresult rv = NS_OK;
// the col group is a target if its path has a reflow command
nsHTMLReflowCommand* command = aReflowState.path->mReflowCommand;

View File

@ -525,7 +525,7 @@ nscoord
nsTableRowFrame::CalcHeight(const nsHTMLReflowState& aReflowState)
{
nsTableFrame* tableFrame = nsnull;
nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame);
nsTableFrame::GetTableFrame(this, tableFrame);
if (!tableFrame) return 0;
nscoord computedHeight = (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight)
@ -915,7 +915,6 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
PRInt32 prevColIndex = firstPrevColIndex;
nscoord x = 0; // running total of children x offset
nsTableFrame* tableFirstInFlow = (nsTableFrame*)aTableFrame.GetFirstInFlow();
PRBool isAutoLayout = aTableFrame.IsAutoLayout();
PRBool needToNotifyTable = PR_TRUE;
nscoord paginatedHeight = 0;
@ -1276,7 +1275,6 @@ nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
// At this point, we know the column widths. Compute the cell available width
PRInt32 cellColIndex;
cellFrame->GetColIndex(cellColIndex);
PRInt32 cellColSpan = aTableFrame.GetEffectiveColSpan(*cellFrame);
nscoord cellSpacingX = aTableFrame.GetCellSpacingX();
nscoord colAvailWidth, cellAvailWidth;

View File

@ -674,7 +674,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext,
rowInfo[rowIndex].pctHeight = nsTableFrame::RoundToPixel(rowFrame->GetHeight(pctHeightBasis), p2t);
}
rowInfo[rowIndex].hasStyleHeight = rowFrame->HasStyleHeight();
nonPctHeight = PR_MAX(nonPctHeight, rowFrame->GetFixedHeight());
nonPctHeight = nsTableFrame::RoundToPixel(PR_MAX(nonPctHeight, rowFrame->GetFixedHeight()), p2t);
}
UpdateHeights(rowInfo[rowIndex], nonPctHeight, heightOfRows, heightOfUnStyledRows);
@ -1088,8 +1088,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsIPresContext* aPresContext,
GET_PIXELS_TO_TWIPS(aPresContext, p2t);
nscoord availWidth = nsTableFrame::RoundToPixel(aReflowState.availableWidth, p2t);
nscoord availHeight = nsTableFrame::RoundToPixel(aReflowState.availableHeight, p2t);
nscoord origAvailHeight = availHeight;
PRBool borderCollapse = ((nsTableFrame*)aTableFrame->GetFirstInFlow())->IsBorderCollapse();
nscoord cellSpacingY = aTableFrame->GetCellSpacingY();