NS_IF_RELEASE(kidType);
void nsTableFrame::InsertColGroups(nsIPresContext& aPresContext,                                   PRInt32         aStartColIndex,                                   nsIFrame*       aFirstFrame,                                   nsIFrame*       aLastFrame){  PRInt32 colIndex = aStartColIndex;  nsTableColGroupFrame* firstColGroupToReset = nsnull;  nsIFrame* kidFrame = aFirstFrame;  PRBool didLastFrame = PR_FALSE;  while (kidFrame) {    nsIAtom* kidType;    kidFrame->GetFrameType(&kidType);    if (nsLayoutAtoms::tableColGroupFrame == kidType) {      if (didLastFrame) {        firstColGroupToReset = (nsTableColGroupFrame*)kidFrame;        break;      }      else {        nsTableColGroupFrame* cgFrame = (nsTableColGroupFrame*)kidFrame;        cgFrame->SetStartColumnIndex(colIndex);        nsIFrame* firstCol;        kidFrame->FirstChild(&aPresContext, nsnull, &firstCol);        cgFrame->AddColsToTable(aPresContext, colIndex, PR_FALSE, firstCol);        PRInt32 numCols = cgFrame->GetColCount();        colIndex += numCols;      }    }    NS_IF_RELEASE(kidType);    if (kidFrame == aLastFrame) {      didLastFrame = PR_TRUE;    }    kidFrame->GetNextSibling(&kidFrame);  }  if (firstColGroupToReset) {    nsTableColGroupFrame::ResetColIndices(&aPresContext, firstColGroupToReset, aStartColIndex);  }}