if (aOldFrame) {     PRBool generateReflowCommand = aOldFrame->GetType() == nsLayoutAtoms::brFrame;  nsInlineFrame* parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent()); while (aOldFrame) { #ifdef IBMBIDI if (nsLayoutAtoms::nextBidi != aListName) { #endif
nsresult rv = NS_OK; PRBool generateReflowCommand = PR_FALSE; nsIFrame* target = nsnull;  nsIFrame* oldFrameParent; if (ParentIsInlineFrame(aOldFrame, &oldFrameParent)) {     nsInlineFrame* parent = (nsInlineFrame*) oldFrameParent; while (nsnull != aOldFrame) {
nsInlineFrame::RemoveFrame(nsPresContext* aPresContext,                           nsIPresShell& aPresShell,                           nsIAtom* aListName,                           nsIFrame* aOldFrame){  if (nsnull != aListName) {#ifdef IBMBIDI    if (nsLayoutAtoms::nextBidi != aListName)#endif    return NS_ERROR_INVALID_ARG;  }  if (aOldFrame) {    // Loop and destroy the frame and all of its continuations.    // If the frame we are removing is a brFrame, we need a reflow so    // the line the brFrame was on can attempt to pull up any frames    // that can fit from lines below it.    PRBool generateReflowCommand =      aOldFrame->GetType() == nsLayoutAtoms::brFrame;    nsInlineFrame* parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent());    while (aOldFrame) {#ifdef IBMBIDI      if (nsLayoutAtoms::nextBidi != aListName) {#endif      // If the frame being removed has zero size then don't bother      // generating a reflow command, otherwise make sure we do.      nsRect bbox = aOldFrame->GetRect();      if (bbox.width || bbox.height) {        generateReflowCommand = PR_TRUE;      }#ifdef IBMBIDI      }#endif      // When the parent is an inline frame we have a simple task - just      // remove the frame from its parents list and generate a reflow      // command.      nsIFrame* oldFrameNextInFlow = aOldFrame->GetNextInFlow();      parent->mFrames.DestroyFrame(aPresContext, aOldFrame);      aOldFrame = oldFrameNextInFlow;      if (aOldFrame) {        parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent());      }    }    if (generateReflowCommand) {      // Ask the parent frame to reflow me.      ReflowDirtyChild(&aPresShell, nsnull);    }  }  return NS_OK;}