Fix crash bug #5621; we weren't pushing frames to the next-in-flow in all cases like we should

This commit is contained in:
kipp%netscape.com 1999-04-29 00:16:44 +00:00
parent e83d736b28
commit fe6e59058f
2 changed files with 26 additions and 6 deletions

View File

@ -242,6 +242,14 @@ nsFirstLetterFrame::Reflow(nsIPresContext& aPresContext,
kid->SetNextSibling(nsnull);
mOverflowFrames.SetFrames(nextInFlow);
}
else {
nsIFrame* nextSib;
kid->GetNextSibling(&nextSib);
if (nextSib) {
kid->SetNextSibling(nsnull);
mOverflowFrames.SetFrames(nextSib);
}
}
}
return rv;
@ -275,7 +283,9 @@ nsFirstLetterFrame::DrainOverflowFrames(nsIPresContext* aPresContext)
// Now repair our first frames style context
nsIFrame* kid = mFrames.FirstChild();
kid->ReResolveStyleContext(aPresContext, mStyleContext,
NS_STYLE_HINT_REFLOW,
nsnull, nsnull);
if (kid) {
kid->ReResolveStyleContext(aPresContext, mStyleContext,
NS_STYLE_HINT_REFLOW,
nsnull, nsnull);
}
}

View File

@ -242,6 +242,14 @@ nsFirstLetterFrame::Reflow(nsIPresContext& aPresContext,
kid->SetNextSibling(nsnull);
mOverflowFrames.SetFrames(nextInFlow);
}
else {
nsIFrame* nextSib;
kid->GetNextSibling(&nextSib);
if (nextSib) {
kid->SetNextSibling(nsnull);
mOverflowFrames.SetFrames(nextSib);
}
}
}
return rv;
@ -275,7 +283,9 @@ nsFirstLetterFrame::DrainOverflowFrames(nsIPresContext* aPresContext)
// Now repair our first frames style context
nsIFrame* kid = mFrames.FirstChild();
kid->ReResolveStyleContext(aPresContext, mStyleContext,
NS_STYLE_HINT_REFLOW,
nsnull, nsnull);
if (kid) {
kid->ReResolveStyleContext(aPresContext, mStyleContext,
NS_STYLE_HINT_REFLOW,
nsnull, nsnull);
}
}