Getting rid of all the printfs and complaints that fire in mailnews by making

the fixed table layout algorithm smarter about unconstrained width reflow.
This commit is contained in:
hyatt%netscape.com 1999-07-23 23:41:05 +00:00
Родитель 07fdb05f24
Коммит ca9519fb92
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -108,7 +108,7 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
nscoord* colWidths = new PRBool[mNumCols];
nsCRT::memset(colWidths, -1, mNumCols*sizeof(nscoord));
// for every column, determine it's specified width
// for every column, determine its specified width
for (colX = 0; colX < mNumCols; colX++) {
// Get column information
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
@ -157,6 +157,11 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
nscoord lastColAllocated = -1;
nscoord remainingWidth = availWidth - totalColWidth;
if (CRAZY_WIDTH(remainingWidth)) {
// let's put a cap on the width so that it doesn't become insane.
remainingWidth = 100;
}
if (tableIsFixedWidth && (0 < remainingWidth)) {
if (mNumCols > specifiedCols) {
// allocate the extra space to the columns which have no width specified

Просмотреть файл

@ -108,7 +108,7 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
nscoord* colWidths = new PRBool[mNumCols];
nsCRT::memset(colWidths, -1, mNumCols*sizeof(nscoord));
// for every column, determine it's specified width
// for every column, determine its specified width
for (colX = 0; colX < mNumCols; colX++) {
// Get column information
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
@ -157,6 +157,11 @@ PRBool FixedTableLayoutStrategy::AssignPreliminaryColumnWidths(nscoord aComputed
nscoord lastColAllocated = -1;
nscoord remainingWidth = availWidth - totalColWidth;
if (CRAZY_WIDTH(remainingWidth)) {
// let's put a cap on the width so that it doesn't become insane.
remainingWidth = 100;
}
if (tableIsFixedWidth && (0 < remainingWidth)) {
if (mNumCols > specifiedCols) {
// allocate the extra space to the columns which have no width specified