PRBool* resized = new PRBool[infoCount];  for (int i=0; i < infoCount; i++) resized[i] = PR_FALSE;
PRBool* resized = nsnull;
nsBoxFrameInner::FlowChildren(nsIPresContext* aPresContext,                     nsHTMLReflowMetrics&     aDesiredSize,                     const nsHTMLReflowState& aReflowState,                     nsReflowStatus&          aStatus,                     nsIFrame*&               aIncrementalChild,                     nsRect& aRect,                     nsSize& aActualSize,                     nscoord& aMaxAscent){      // ------- set the childs positions ---------  PRBool redraw = PR_FALSE;  PRBool finished;  nscoord passes = 0;  nscoord changedIndex = -1;  nsAutoString reason;  nsAutoString nextReason;  PRInt32 infoCount = mInfoList->GetCount();  PRBool* resized = new PRBool[infoCount];  for (int i=0; i < infoCount; i++)       resized[i] = PR_FALSE;   // ----------------------  // Flow all children   // ----------------------  // ok what we want to do if flow each child at the location given in the spring.  // unfortunately after flowing a child it might get bigger. We have not control over this  // so it the child gets bigger or smaller than we expected we will have to do a 2nd, 3rd, 4th pass to   // adjust. When we adjust make sure the new reason is resize.  changedIndex = -1;  passes = 0;  do   {     #ifdef DEBUG_REFLOW      if (passes > 0) {           AddIndents();           printf("ChildResized doing pass: %d\n", passes);      }    #endif     finished = PR_TRUE;    nscoord count = 0;    nsCalculatedBoxInfo* info = mInfoList->GetFirst();    nscoord x = aRect.x;    nscoord y = aRect.y;    if (!(mOuter->mState & NS_STATE_AUTO_STRETCH)) {        if (mOuter->mState & NS_STATE_IS_HORIZONTAL) {           switch(mHalign) {              case nsBoxFrame::hAlign_Left:                 x = aRect.x;              break;              case nsBoxFrame::hAlign_Center:                 x = aRect.x + (aActualSize.width - aRect.width)/2;              break;              case nsBoxFrame::hAlign_Right:                 x = aRect.x + (aActualSize.width - aRect.width);              break;           }        } else {            switch(mValign) {              case nsBoxFrame::vAlign_Top:              case nsBoxFrame::vAlign_BaseLine:                 y = aRect.y;              break;              case nsBoxFrame::vAlign_Middle:                 y = aRect.y + (aActualSize.height - aRect.height)/2;              break;              case nsBoxFrame::vAlign_Bottom:                 y = aRect.y + (aActualSize.height - aRect.height);              break;            }        }    }    while (nsnull != info)     {           nsIFrame* childFrame = info->frame;       NS_ASSERTION(info, "ERROR not info object!!");        // if we reached the index that changed we are done.       //if (count == changedIndex)       //    break;       // make collapsed children not show up        if (info->mFlags & NS_FRAME_BOX_IS_COLLAPSED) {          if (aReflowState.reason == eReflowReason_Initial)	      {                FlowChildAt(childFrame, aPresContext, aDesiredSize, aReflowState, aStatus, *info, x, y, PR_TRUE, aIncrementalChild, redraw, reason);                // if the child got bigger then adjust our rect and all the children.                mOuter->ChildResized(childFrame, aDesiredSize, aRect, aMaxAscent, *info, resized, changedIndex, finished, count, nextReason);	      }          // ok if we are collapsed make sure the view and all its children          // are collapsed as well.           nsRect rect(0,0,0,0);           childFrame->GetRect(rect);           if (rect.width > 0 || rect.height > 0)            {              childFrame->SizeTo(aPresContext, 0,0);                     mOuter->CollapseChild(aPresContext, childFrame, PR_TRUE);           }           /*          nsRect rect(0,0,0,0);          childFrame->GetRect(rect);          if (rect.width > 0 || rect.height > 0) {              nsIView* view;              childFrame->GetView(aPresContext, &view);             if (view) {                nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, childFrame,                                                           view, nsnull);              } else {                // Re-position any child frame views                nsContainerFrame::PositionChildViews(aPresContext, childFrame);              }          }          */        } else {          nscoord nextX = x;          nscoord nextY = y;          mOuter->ComputeChildsNextPosition(info, x, y, nextX, nextY, info->calculatedSize, aRect, aMaxAscent);          // reflow if the child needs it or we are on a second pass          FlowChildAt(childFrame, aPresContext, aDesiredSize, aReflowState, aStatus, *info, x, y, PR_TRUE, aIncrementalChild, redraw, reason);           // if the child got bigger then adjust our rect and all the children.          mOuter->ChildResized(childFrame, aDesiredSize, aRect, aMaxAscent, *info, resized, changedIndex, finished, count, nextReason);          /*#ifdef DEBUG_REFLOW          if (!finished) {              AddIndents();              printf("**** Child ");              nsFrame::ListTag(stdout, childFrame);              printf(" resized!******\n");              AddIndents();              char ch[100];              nextReason.ToCString(ch,100);              printf("because (%s)\n", ch);          }#endif          */          // always do 1 pass for now.          //finished = PR_TRUE;                  // if the child resized then recompute it position.          if (!finished) {              mOuter->ComputeChildsNextPosition(info, x, y, nextX, nextY, nsSize(aDesiredSize.width, aDesiredSize.height), aRect, aMaxAscent);          }          x = nextX;          y = nextY;        }        info = info->next;        count++;    }    // ok if something go bigger and we need to do another pass then    // the second pass will be reflow resize    reason = nextReason;    // if we get over 10 passes something probably when wrong.    passes++;    if (passes > 5) {//      mOuter->NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,  //               ("bug"));    }    //NS_ASSERTION(passes <= 10,"Error infinte loop too many passes");    if (passes > 10) {       break;    }  } while (PR_FALSE == finished);  // if the rect inside us changes size. Mainly if it gets smaller redraw.  // this will make use draw when children have removed.  nscoord newInnerSize;  if (mOuter->mState & NS_STATE_IS_HORIZONTAL)      newInnerSize = aRect.width;  else      newInnerSize = aRect.height;  if (mInnerSize != newInnerSize)  {      mInnerSize = newInnerSize;      redraw = PR_TRUE;  }            // redraw things if needed.  if (redraw) {#ifdef DEBUG_REDRAW      mInner->ListTag(stdout);      printf("is being redrawn\n");#endif    mOuter->Invalidate(aPresContext, nsRect(0,0,mOuter->mRect.width, mOuter->mRect.height), PR_FALSE);  }  delete[] resized;  return NS_OK;}