support for Nav4 compatibility -- auto-width cells with 0-width content are 1 pixel wide

This commit is contained in:
buster
1998-06-26 23:31:33 +00:00
parent 30333abc30
commit 1272ec01e8
6 changed files with 64 additions and 10 deletions
@@ -16,7 +16,6 @@
* Reserved.
*/
#include <stdio.h>
#include "BasicTableLayoutStrategy.h"
#include "nsTableFrame.h"
#include "nsTableColFrame.h"
@@ -946,8 +945,12 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(nsIPresContext* aPresCo
{
PRInt32 colIndex = autoColumns[i];
nscoord oldColWidth = mTableFrame->GetColumnWidth(colIndex);
float percent = (float)oldColWidth/(float)totalWidthOfAutoColumns;
nscoord excessForThisColumn = excess*percent;
float percent;
if (0!=totalWidthOfAutoColumns)
percent = (float)oldColWidth/(float)totalWidthOfAutoColumns;
else
percent = (float)1/(float)numAutoColumns;
nscoord excessForThisColumn = (nscoord)(excess*percent);
nscoord colWidth = excessForThisColumn+oldColWidth;
if (gsDebug==PR_TRUE)
printf(" column %d was %d, now set to %d\n", colIndex, mTableFrame->GetColumnWidth(colIndex), colWidth);