nsLineBox* lastLine = nsLineBox::LastLine(mLines);
LineData* lastLine = LastLine(mLines);
nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,                              nsIFrame* aNewFrame){  // Get our last line and then get its last child  nsIFrame* lastFrame;  nsLineBox* lastLine = nsLineBox::LastLine(mLines);  if (nsnull != lastLine) {    lastFrame = lastLine->LastChild();  } else {    lastFrame = nsnull;  }  // Add the new frames to the sibling list; wrap any frames that  // require wrapping  if (nsnull != lastFrame) {    lastFrame->SetNextSibling(aNewFrame);  }  nsresult rv;  // Make sure that new inlines go onto the end of the lastLine when  // the lastLine is mapping inline frames.  PRInt32 pendingInlines = 0;  if (nsnull != lastLine) {    if (!lastLine->IsBlock()) {      pendingInlines = 1;    }  }  // Now create some lines for the new frames  nsIFrame* prevFrame = lastFrame;  for (nsIFrame* frame = aNewFrame; nsnull != frame;       frame->GetNextSibling(&frame)) {    // See if the child is a block or non-block    const nsStyleDisplay* kidDisplay;    rv = frame->GetStyleData(eStyleStruct_Display,                             (const nsStyleStruct*&) kidDisplay);    if (NS_OK != rv) {      return rv;    }    const nsStylePosition* kidPosition;    rv = frame->GetStyleData(eStyleStruct_Position,                             (const nsStyleStruct*&) kidPosition);    if (NS_OK != rv) {      return rv;    }    PRBool isBlock = nsLineLayout::TreatFrameAsBlock(kidDisplay, kidPosition);    // If the child is an inline then add it to the lastLine (if it's    // an inline line, otherwise make a new line). If the child is a    // block then make a new line and put the child in that line.    if (isBlock) {      // If the previous line has pending inline data to be reflowed,      // do so now.      if (0 != pendingInlines) {        // Set this to true in case we don't end up reflowing all of the        // frames on the line (because they end up being pushed).        lastLine->MarkDirty();        pendingInlines = 0;      }      // Create a line for the block      nsLineBox* line = new nsLineBox(frame, 1, LINE_IS_BLOCK);      if (nsnull == line) {        return NS_ERROR_OUT_OF_MEMORY;      }      if (nsnull == lastLine) {        mLines = line;      }      else {        lastLine->mNext = line;      }      lastLine = line;    }    else {      if (0 == pendingInlines) {        nsLineBox* line = new nsLineBox(frame, 0, 0);        if (nsnull == line) {          return NS_ERROR_OUT_OF_MEMORY;        }        if (nsnull == lastLine) {          mLines = line;        }        else {          lastLine->mNext = line;        }        lastLine = line;      }      lastLine->mChildCount++;      pendingInlines++;    }    // Remember the previous frame    prevFrame = frame;  }  if (0 != pendingInlines) {    // Set this to true in case we don't end up reflowing all of the    // frames on the line (because they end up being pushed).    lastLine->MarkDirty();  }  MarkEmptyLines(aPresContext);  return NS_OK;}