diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index f52ab62ac572..5835917e98e5 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1925,13 +1925,12 @@ nsFrame::GetSelectionController(nsIPresContext *aPresContext, nsISelectionContro if (state & NS_FRAME_INDEPENDENT_SELECTION) { nsIFrame *tmp = this; - nsIFrame *parent; - while ( NS_SUCCEEDED(tmp->GetParent(&parent)) && parent) + while ( NS_SUCCEEDED(tmp->GetParent(&tmp)) && tmp) { - parent->GetFrameState(&state); + tmp->GetFrameState(&state); if (! (state & NS_FRAME_INDEPENDENT_SELECTION)) //we have found the nsGfx* { - nsFrame* castParent = NS_STATIC_CAST(nsFrame *,parent); + nsFrame* castParent = NS_STATIC_CAST(nsFrame *,tmp); return castParent->GetSelectionController(aPresContext, aSelCon); } } diff --git a/layout/html/base/src/nsFrame.cpp b/layout/html/base/src/nsFrame.cpp index f52ab62ac572..5835917e98e5 100644 --- a/layout/html/base/src/nsFrame.cpp +++ b/layout/html/base/src/nsFrame.cpp @@ -1925,13 +1925,12 @@ nsFrame::GetSelectionController(nsIPresContext *aPresContext, nsISelectionContro if (state & NS_FRAME_INDEPENDENT_SELECTION) { nsIFrame *tmp = this; - nsIFrame *parent; - while ( NS_SUCCEEDED(tmp->GetParent(&parent)) && parent) + while ( NS_SUCCEEDED(tmp->GetParent(&tmp)) && tmp) { - parent->GetFrameState(&state); + tmp->GetFrameState(&state); if (! (state & NS_FRAME_INDEPENDENT_SELECTION)) //we have found the nsGfx* { - nsFrame* castParent = NS_STATIC_CAST(nsFrame *,parent); + nsFrame* castParent = NS_STATIC_CAST(nsFrame *,tmp); return castParent->GetSelectionController(aPresContext, aSelCon); } }