diff --git a/layout/mathml/base/src/nsMathMLTokenFrame.cpp b/layout/mathml/base/src/nsMathMLTokenFrame.cpp index 5be14bb8243..ffcaf7da947 100644 --- a/layout/mathml/base/src/nsMathMLTokenFrame.cpp +++ b/layout/mathml/base/src/nsMathMLTokenFrame.cpp @@ -198,15 +198,13 @@ nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext, nsHTMLReflowMetrics& aDesiredSize) { mBoundingMetrics.Clear(); - nsIFrame* childFrame = GetFirstChild(nsnull); - while (childFrame) { + for (nsIFrame* childFrame = GetFirstChild(nsnull); childFrame; + childFrame = childFrame->GetNextSibling()) { nsHTMLReflowMetrics childSize; GetReflowAndBoundingMetricsFor(childFrame, childSize, childSize.mBoundingMetrics, nsnull); // compute and cache the bounding metrics mBoundingMetrics += childSize.mBoundingMetrics; - - childFrame = childFrame->GetNextSibling(); } nsCOMPtr fm = @@ -223,8 +221,8 @@ nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext, if (aPlaceOrigin) { nscoord dy, dx = 0; - nsIFrame* childFrame = GetFirstChild(nsnull); - while (childFrame) { + for (nsIFrame* childFrame = GetFirstChild(nsnull); childFrame; + childFrame = childFrame->GetNextSibling()) { nsHTMLReflowMetrics childSize; GetReflowAndBoundingMetricsFor(childFrame, childSize, childSize.mBoundingMetrics); @@ -233,7 +231,6 @@ nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext, dy = childSize.height == 0 ? 0 : aDesiredSize.ascent - childSize.ascent; FinishReflowChild(childFrame, PresContext(), nsnull, childSize, dx, dy, 0); dx += childSize.width; - childFrame = childFrame->GetNextSibling(); } }