Optimized Reflow() some more. In the case where we're not measuring text but

we need to peek ahead and so we need to know the length of the last word, if
there's only one word in the text run then we can avoid measuring
This commit is contained in:
troy%netscape.com 1999-09-19 04:42:54 +00:00
parent 2c5c80b40d
commit f004ab4be8
2 changed files with 10 additions and 2 deletions

View File

@ -2611,7 +2611,11 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
if (!measureText) {
// We didn't measure any text so we don't know lastWordWidth.
// We have to compute it now
if (ts.mSmallCaps) {
if (prevOffset == startingOffset) {
// There's only one word, so we don't have to measure after all
lastWordWidth = x;
}
else if (ts.mSmallCaps) {
MeasureSmallCapsText(aReflowState, ts, tx.GetTextAt(prevOffset),
lastWordLen, &lastWordWidth);
}

View File

@ -2611,7 +2611,11 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
if (!measureText) {
// We didn't measure any text so we don't know lastWordWidth.
// We have to compute it now
if (ts.mSmallCaps) {
if (prevOffset == startingOffset) {
// There's only one word, so we don't have to measure after all
lastWordWidth = x;
}
else if (ts.mSmallCaps) {
MeasureSmallCapsText(aReflowState, ts, tx.GetTextAt(prevOffset),
lastWordLen, &lastWordWidth);
}