bad infiniteloop fix

This commit is contained in:
mjudge%netscape.com 2000-05-05 02:38:03 +00:00
parent c30da52a01
commit 450040c157
2 changed files with 6 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}