rowGroupIndex++;  isRepeatedHeader = PR_FALSE; isRepeatedFooter = PR_FALSE;  if (rowGroupIndex < rowGroups.Count()) { prevRg = rg; nsIFrame* frame = (nsTableRowGroupFrame*)rowGroups.ElementAt(rowGroupIndex); if (!frame) ABORT1(PR_FALSE); rg = table->GetRowGroupFrame(frame); if (!rg) ABORT1(PR_FALSE); fifRowGroupStart = ((nsTableRowGroupFrame*)rg->GetFirstInFlow())->GetStartRowIndex(); rowGroupStart    = rg->GetStartRowIndex(); rowGroupEnd      = rowGroupStart + rg->GetRowCount() - 1;  if (SetNewRow(rg->GetFirstRow())) { cellMap = tableCellMap->GetMapFor(*(nsTableRowGroupFrame*)rg->GetFirstInFlow()); } if (rg && table->GetPrevInFlow() && !rg->GetPrevInFlow()) {  const nsStyleDisplay* display; rg->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display); if (y == startY) { isRepeatedHeader = (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == display->mDisplay);
mAtEnd = PR_TRUE; mRowGroupIndex++; PRInt32 numRowGroups = mRowGroups.Count(); for (PRInt32 rgX = mRowGroupIndex; rgX < numRowGroups; rgX++) { nsIFrame* frame = (nsTableRowGroupFrame*)mRowGroups.ElementAt(mRowGroupIndex); if (!frame) ABORT1(PR_FALSE); mRowGroup = mTableFrame.GetRowGroupFrame(frame); if (!mRowGroup) ABORT1(PR_FALSE); mRowGroupStart = mRowGroup->GetStartRowIndex(); mRowGroupEnd   = mRowGroupStart + mRowGroup->GetRowCount() - 1; if (mRowGroupEnd >= 0) { mCellMap  = mTableCellMap->GetMapFor(*mRowGroup); nsTableRowFrame* firstRow = mRowGroup->GetFirstRow(); if (aFindFirstDamagedRow) { if ((mAreaStart.y >= mRowGroupStart) && (mAreaStart.y <= mRowGroupEnd)) {  if (aFindFirstDamagedRow) {  PRInt32 numRows = mAreaStart.y - mRowGroupStart; for (PRInt32 i = 0; i < numRows; i++) { firstRow = firstRow->GetNextRow(); if (!frame) ABORT1(PR_FALSE); } } } else { mRowGroupIndex++; continue; }
BCMapBorderIterator::SetNewRowGroup(){  rowGroupIndex++;  isRepeatedHeader = PR_FALSE;  isRepeatedFooter = PR_FALSE;  if (rowGroupIndex < rowGroups.Count()) {    prevRg = rg;    nsIFrame* frame = (nsTableRowGroupFrame*)rowGroups.ElementAt(rowGroupIndex); if (!frame) ABORT1(PR_FALSE);    rg = table->GetRowGroupFrame(frame); if (!rg) ABORT1(PR_FALSE);    fifRowGroupStart = ((nsTableRowGroupFrame*)rg->GetFirstInFlow())->GetStartRowIndex();    rowGroupStart    = rg->GetStartRowIndex();     rowGroupEnd      = rowGroupStart + rg->GetRowCount() - 1;    if (SetNewRow(rg->GetFirstRow())) {      cellMap = tableCellMap->GetMapFor(*(nsTableRowGroupFrame*)rg->GetFirstInFlow());     }    if (rg && table->GetPrevInFlow() && !rg->GetPrevInFlow()) {      // if rg doesn't have a prev in flow, then it may be a repeated header or footer      const nsStyleDisplay* display;      rg->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);      if (y == startY) {        isRepeatedHeader = (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == display->mDisplay);      }      else {        isRepeatedFooter = (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == display->mDisplay);      }    }  }  else {    atEnd = PR_TRUE;  }  return !atEnd;}