From fccc6aa55c32220b996729a8b4722aa7cf53c5cb Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 28 Jul 2009 08:51:09 -0400 Subject: [PATCH] Bug 504221 part 2. Switch ReparentFrameViewList to nsFrameList. r+sr=roc --- layout/generic/nsHTMLContainerFrame.cpp | 15 +++++++-------- layout/generic/nsHTMLContainerFrame.h | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 6a99d103c4c..5b241b5830a 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -611,12 +611,12 @@ nsHTMLContainerFrame::ReparentFrameView(nsPresContext* aPresContext, } nsresult -nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext, - nsIFrame* aChildFrameList, - nsIFrame* aOldParentFrame, - nsIFrame* aNewParentFrame) +nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext, + const nsFrameList& aChildFrameList, + nsIFrame* aOldParentFrame, + nsIFrame* aNewParentFrame) { - NS_PRECONDITION(aChildFrameList, "null child frame list"); + NS_PRECONDITION(aChildFrameList.NotEmpty(), "empty child frame list"); NS_PRECONDITION(aOldParentFrame, "null old parent frame pointer"); NS_PRECONDITION(aNewParentFrame, "null new parent frame pointer"); NS_PRECONDITION(aOldParentFrame != aNewParentFrame, "same old and new parent frame"); @@ -665,9 +665,8 @@ nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext, nsIViewManager* viewManager = oldParentView->GetViewManager(); // They're not so we need to reparent any child views - for (nsIFrame* f = aChildFrameList; f; f = f->GetNextSibling()) { - ReparentFrameViewTo(f, viewManager, newParentView, - oldParentView); + for (nsFrameList::Enumerator e(aChildFrameList); !e.AtEnd(); e.Next()) { + ReparentFrameViewTo(e.get(), viewManager, newParentView, oldParentView); } } diff --git a/layout/generic/nsHTMLContainerFrame.h b/layout/generic/nsHTMLContainerFrame.h index f5ee84d28dd..17501e37a7a 100644 --- a/layout/generic/nsHTMLContainerFrame.h +++ b/layout/generic/nsHTMLContainerFrame.h @@ -96,10 +96,10 @@ public: nsIFrame* aOldParentFrame, nsIFrame* aNewParentFrame); - static nsresult ReparentFrameViewList(nsPresContext* aPresContext, - nsIFrame* aChildFrameList, - nsIFrame* aOldParentFrame, - nsIFrame* aNewParentFrame); + static nsresult ReparentFrameViewList(nsPresContext* aPresContext, + const nsFrameList& aChildFrameList, + nsIFrame* aOldParentFrame, + nsIFrame* aNewParentFrame); /** * Displays the standard border, background and outline for the frame