const nsStyleDisplay* groupDisplay; groupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)groupDisplay)); PRBool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupDisplay->mVisible);
const nsStyleVisibility* groupVis; groupFrame->GetStyleData(eStyleStruct_Visibility, ((const nsStyleStruct *&)groupVis));  PRBool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupVis->mVisible);
NS_METHOD nsTableFrame::AdjustForCollapsingCols(nsIPresContext* aPresContext,                                                 nscoord&        aWidth){  nsTableCellMap* cellMap = GetCellMap();  if (!cellMap) return NS_OK;  PRInt32 numRows = cellMap->GetRowCount();  nsTableIterator groupIter(mColGroups, eTableDIR);  nsIFrame* groupFrame = groupIter.First();   nscoord cellSpacingX = GetCellSpacingX();  nscoord xOffset = 0;  PRInt32 colX = (groupIter.IsLeftToRight()) ? 0 : GetColCount() - 1;   PRInt32 direction = (groupIter.IsLeftToRight()) ? 1 : -1;   // iterate over the col groups  while (nsnull != groupFrame) {    const nsStyleDisplay* groupDisplay;    groupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)groupDisplay));    PRBool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupDisplay->mVisible);    nsTableIterator colIter(aPresContext, *groupFrame, eTableDIR);    nsIFrame* colFrame = colIter.First();    // iterate over the cols in the col group    while (nsnull != colFrame) {      const nsStyleDisplay* colDisplay;      colFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)colDisplay));      if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay) {        PRBool collapseCol = (NS_STYLE_VISIBILITY_COLLAPSE == colDisplay->mVisible);        PRInt32 colWidth = GetColumnWidth(colX);        if (collapseGroup || collapseCol) {          xOffset += colWidth + cellSpacingX;        }        nsTableCellFrame* lastCell  = nsnull;        nsTableCellFrame* cellFrame = nsnull;        for (PRInt32 rowX = 0; rowX < numRows; rowX++) {          CellData* cellData = cellMap->GetCellAt(rowX, colX);          nsRect cellRect;          if (cellData) {            if (cellData->IsOrig()) { // the cell originates at (rowX, colX)              cellFrame = cellData->GetCellFrame();              // reset the collapse offsets since they may have been collapsed previously              cellFrame->SetCollapseOffsetX(aPresContext, 0);              cellFrame->SetCollapseOffsetY(aPresContext, 0);              cellFrame->GetRect(cellRect);              if (collapseGroup || collapseCol) {                if (lastCell != cellFrame) { // do it only once if there is a row span                  cellRect.width -= colWidth;                  cellFrame->SetCollapseOffsetX(aPresContext, -xOffset);                }              } else { // the cell is not in a collapsed col but needs to move                cellRect.x -= xOffset;              }              cellFrame->SetRect(aPresContext, cellRect);              // if the cell does not originate at (rowX, colX), adjust the real cells width            } else if (collapseGroup || collapseCol) {               if (cellData->IsColSpan()) {                cellFrame = cellMap->GetCellFrame(rowX, colX, *cellData, PR_FALSE);              }              if ((cellFrame) && (lastCell != cellFrame)) {                cellFrame->GetRect(cellRect);                cellRect.width -= colWidth + cellSpacingX;                cellFrame->SetRect(aPresContext, cellRect);              }            }          }          lastCell = cellFrame;        }        colX += direction;      }      colFrame = colIter.Next();    } // inner while    groupFrame = groupIter.Next();  } // outer while  aWidth -= xOffset;   return NS_OK;}