Bug 398181: Use NSCoordSaturatingAdd/Subtract in 3 places where we might have unconstrained heights. r+sr+a=roc

This commit is contained in:
dholbert@cs.stanford.edu 2007-11-09 09:16:36 -08:00
parent 61dc67815b
commit e1c9f57e6d
2 changed files with 3 additions and 3 deletions

View File

@ -2866,12 +2866,12 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext
if (floats_cur > floats_done)
floats_done = floats_cur;
currentLine += floats_done;
currentLine = NSCoordSaturatingAdd(currentLine, floats_done);
floats.Clear();
}
currentLine -= trailingWhitespace;
currentLine = NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX);
prevLines = PR_MAX(prevLines, currentLine);
currentLine = trailingWhitespace = 0;
}

View File

@ -4933,7 +4933,7 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
// onto one line, so just measure it
nscoord width =
NSToCoordCeil(mTextRun->GetAdvanceWidth(start, flowEndInTextRun - start, &provider));
aData->currentLine += width;
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
PRUint32 trimStart = GetEndOfTrimmedText(provider.GetFragment(), start,
flowEndInTextRun, &iter);