PRInt32 rgRowIndex = aCellInfo.rowIndex - mRowGroupStart;
BCMapCellIterator::SetInfo(nsTableRowFrame* aRow,                           PRInt32          aColIndex,                           CellData*        aCellData,                           BCMapCellInfo&   aCellInfo,                           nsCellMap*       aCellMap){  aCellInfo.cellData = aCellData;  aCellInfo.cellMap = (aCellMap) ? aCellMap : mCellMap;  aCellInfo.colIndex = aColIndex;  // row frame info  aCellInfo.rowIndex = 0;  if (aRow) {    aCellInfo.topRow = aRow;     aCellInfo.rowIndex = aRow->GetRowIndex();  }  // cell frame info  aCellInfo.cell      = nsnull;  aCellInfo.rowSpan   = 1;  aCellInfo.colSpan  = 1;  if (aCellData) {    aCellInfo.cell = (nsBCTableCellFrame*)aCellData->GetCellFrame();     if (aCellInfo.cell) {      if (!aCellInfo.topRow) {        aCellInfo.cell->GetParent((nsIFrame**)&aCellInfo.topRow); if (!aCellInfo.topRow) ABORT0();        aCellInfo.rowIndex = aCellInfo.topRow->GetRowIndex();      }      PRInt32 rgRowIndex = aCellInfo.rowIndex - mRowGroupStart;      aCellInfo.colSpan = mTableFrame.GetEffectiveColSpan(*aCellInfo.cell, aCellMap);       aCellInfo.rowSpan = mTableFrame.GetEffectiveRowSpan(*aCellInfo.cell, aCellMap);    }  }  if (!aCellInfo.topRow) {    aCellInfo.topRow = mRow;  }  if (1 == aCellInfo.rowSpan) {    aCellInfo.bottomRow = aCellInfo.topRow;  }  else {    aCellInfo.bottomRow = aCellInfo.topRow->GetNextRow();    if (aCellInfo.bottomRow) {      for (PRInt32 spanX = 2; aCellInfo.bottomRow && (spanX < aCellInfo.rowSpan); spanX++) {        aCellInfo.bottomRow = aCellInfo.bottomRow->GetNextRow();      }      NS_ASSERTION(aCellInfo.bottomRow, "program error");    }    else {      NS_ASSERTION(PR_FALSE, "error in cell map");      aCellInfo.rowSpan = 1;      aCellInfo.bottomRow = aCellInfo.topRow;    }  }  // row group frame info  PRUint32 rgStart  = mRowGroupStart;  PRUint32 rgEnd    = mRowGroupEnd;  nsIFrame* parentFrame = nsnull;  aCellInfo.topRow->GetParent((nsIFrame**)&parentFrame);  aCellInfo.rg = mTableFrame.GetRowGroupFrame(parentFrame);  if (aCellInfo.rg != mRowGroup) {    rgStart = aCellInfo.rg->GetStartRowIndex();    rgEnd   = rgStart + aCellInfo.rg->GetRowCount() - 1;  }  PRUint32 rowIndex  = aCellInfo.topRow->GetRowIndex();  aCellInfo.rgTop    = (rgStart == rowIndex);  aCellInfo.rgBottom = (rgEnd == rowIndex + aCellInfo.rowSpan - 1);  // col frame info  aCellInfo.leftCol = mTableFrame.GetColFrame(aColIndex); if (!aCellInfo.leftCol) ABORT0();  aCellInfo.rightCol = aCellInfo.leftCol;  if (aCellInfo.colSpan > 1) {    for (PRInt32 spanX = 1; spanX < aCellInfo.colSpan; spanX++) {      nsTableColFrame* colFrame = mTableFrame.GetColFrame(aColIndex + spanX); if (!colFrame) ABORT0();      aCellInfo.rightCol = colFrame;    }  }  // col group frame info  aCellInfo.leftCol->GetParent((nsIFrame**)&aCellInfo.cg);  PRInt32 cgStart  = aCellInfo.cg->GetStartColumnIndex();  PRInt32 cgEnd    = PR_MAX(0, cgStart + aCellInfo.cg->GetColCount() - 1);  aCellInfo.cgLeft  = (cgStart == aColIndex);  aCellInfo.cgRight = (cgEnd == aColIndex + (PRInt32)aCellInfo.colSpan - 1);}