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
Родитель 2c5c80b40d
Коммит f004ab4be8
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}