mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-02 12:29:56 +00:00
Fix trimmedOffsets arithmetic in GetRenderedText().
This commit is contained in:
@@ -8882,9 +8882,13 @@ nsTextFrame::GetRenderedText(uint32_t aStartOffset,
|
||||
startOffset = aStartOffset;
|
||||
endOffset = std::min<uint32_t>(INT32_MAX, aEndOffset);
|
||||
}
|
||||
|
||||
// If startOffset and/or endOffset are inside of trimmedOffsets' range,
|
||||
// then clamp the edges of trimmedOffsets accordingly.
|
||||
int32_t origTrimmedOffsetsEnd = trimmedOffsets.GetEnd();
|
||||
trimmedOffsets.mStart = std::max<uint32_t>(trimmedOffsets.mStart,
|
||||
startOffset);
|
||||
trimmedOffsets.mLength = std::min<uint32_t>(trimmedOffsets.GetEnd(),
|
||||
trimmedOffsets.mLength = std::min<uint32_t>(origTrimmedOffsetsEnd,
|
||||
endOffset) - trimmedOffsets.mStart;
|
||||
if (trimmedOffsets.mLength <= 0) {
|
||||
offsetInRenderedString = nextOffsetInRenderedString;
|
||||
|
||||
Reference in New Issue
Block a user