if (colWidth > 0) { aColAvailWidth += colWidth;
if (colWidth != WIDTH_NOT_SET) { if (NS_UNCONSTRAINEDSIZE == aColAvailWidth) { aColAvailWidth = colWidth; } else { aColAvailWidth += colWidth; }
CalcAvailWidth(nsTableFrame&     aTableFrame,               nscoord           aTableComputedWidth,               float             aPixelToTwips,               nsTableCellFrame& aCellFrame,               nscoord           aCellSpacingX,               nscoord&          aColAvailWidth,               nscoord&          aCellAvailWidth){  aColAvailWidth = aCellAvailWidth = 0;  PRInt32 colIndex;  aCellFrame.GetColIndex(colIndex);  PRInt32 colspan = aTableFrame.GetEffectiveColSpan(aCellFrame);  nscoord cellSpacing = 0;  for (PRInt32 spanX = 0; spanX < colspan; spanX++) {    nscoord colWidth = aTableFrame.GetColumnWidth(colIndex + spanX);    if (colWidth > 0) {      aColAvailWidth += colWidth;    }    if ((spanX > 0) && (aTableFrame.GetNumCellsOriginatingInCol(colIndex + spanX) > 0)) {      cellSpacing += aCellSpacingX;    }  }  if (aColAvailWidth > 0) {    aColAvailWidth += cellSpacing;  }   aCellAvailWidth = aColAvailWidth;  // for a cell with a colspan > 1, use its fix width (if set) as the avail width   // if this is its initial reflow  if ((aCellFrame.GetStateBits() & NS_FRAME_FIRST_REFLOW)      && (aTableFrame.GetEffectiveColSpan(aCellFrame) > 1)) {    // see if the cell has a style width specified    const nsStylePosition* cellPosition = aCellFrame.GetStylePosition();    if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit()) {      // need to add padding into fixed width      nsMargin borderPadding(0,0,0,0);      if (NS_UNCONSTRAINEDSIZE != aTableComputedWidth) {        borderPadding = nsTableFrame::GetBorderPadding(nsSize(aTableComputedWidth, 0),                                                        aPixelToTwips,  &aCellFrame);      }      nscoord fixWidth = cellPosition->mWidth.GetCoordValue() + borderPadding.left + borderPadding.right;      aCellAvailWidth = PR_MIN(aColAvailWidth, fixWidth);    }  }}