Make nsContinuingTextFrame::GetFirstInFlow not crash. b=189515 r+sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@136597 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
725aacf0d2
commit
e44c2a9f95
@ -966,11 +966,14 @@ nsContinuingTextFrame::Destroy(nsIPresContext* aPresContext)
|
||||
nsIFrame*
|
||||
nsContinuingTextFrame::GetFirstInFlow() const
|
||||
{
|
||||
nsContinuingTextFrame* firstInFlow = (nsContinuingTextFrame*)this;
|
||||
while (firstInFlow->mPrevInFlow) {
|
||||
firstInFlow = (nsContinuingTextFrame*)firstInFlow->mPrevInFlow;
|
||||
}
|
||||
NS_POSTCONDITION(firstInFlow, "illegal state in flow chain.");
|
||||
// Can't cast to |nsContinuingTextFrame*| because the first one isn't.
|
||||
nsIFrame *firstInFlow,
|
||||
*previous = NS_CONST_CAST(nsIFrame*,
|
||||
NS_STATIC_CAST(const nsIFrame*, this));
|
||||
do {
|
||||
firstInFlow = previous;
|
||||
firstInFlow->GetPrevInFlow(&previous);
|
||||
} while (previous);
|
||||
return firstInFlow;
|
||||
}
|
||||
|
||||
|
||||
@ -966,11 +966,14 @@ nsContinuingTextFrame::Destroy(nsIPresContext* aPresContext)
|
||||
nsIFrame*
|
||||
nsContinuingTextFrame::GetFirstInFlow() const
|
||||
{
|
||||
nsContinuingTextFrame* firstInFlow = (nsContinuingTextFrame*)this;
|
||||
while (firstInFlow->mPrevInFlow) {
|
||||
firstInFlow = (nsContinuingTextFrame*)firstInFlow->mPrevInFlow;
|
||||
}
|
||||
NS_POSTCONDITION(firstInFlow, "illegal state in flow chain.");
|
||||
// Can't cast to |nsContinuingTextFrame*| because the first one isn't.
|
||||
nsIFrame *firstInFlow,
|
||||
*previous = NS_CONST_CAST(nsIFrame*,
|
||||
NS_STATIC_CAST(const nsIFrame*, this));
|
||||
do {
|
||||
firstInFlow = previous;
|
||||
firstInFlow->GetPrevInFlow(&previous);
|
||||
} while (previous);
|
||||
return firstInFlow;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user