Don't iterate past the beginning line (crash fix). b=350370 r+sr=bzbarsky

This commit is contained in:
mats.palmgren%bredband.net 2006-08-28 07:30:01 +00:00
parent 99aaae7727
commit 31e06677ed

View File

@ -1657,12 +1657,22 @@ nsBlockFrame::RetargetInlineIncrementalReflow(nsReflowPath::iterator &aTarget,
// Now fix the iterator, keeping track of how many lines we walk
// back through.
PRInt32 lineCount = 0;
const line_iterator begin = begin_lines();
do {
// XXX this might happen if the block is split; e.g.,
// printing or print preview. For now, panic.
NS_ASSERTION(aLine != begin_lines(),
"ran out of lines before we ran out of prev-in-flows");
// printing or print preview.
if (aLine == begin) {
#ifdef NS_DEBUG
if (GetParent() == aPrevInFlow->GetParent()) {
NS_ERROR("ran out of lines before we ran out of prev-in-flows");
}
else {
NS_ERROR("not yet implemented: retarget incremental reflow to"
" prev-in-flow with different parent");
}
#endif
break;
}
// Is the previous line a ``hard'' break? If so, stop: these
// continuations will be preserved during an unconstrained reflow.
// XXXwaterson should this be `!= NS_STYLE_CLEAR_NONE'?