mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1718924 - part 8: Add OffsetEntry::OffsetInTextInBlockIsInRangeOrEndOffset()
r=m_kato
Depends on D119154 Differential Revision: https://phabricator.services.mozilla.com/D119155
This commit is contained in:
parent
36c6e61f3c
commit
9ccb5fd526
@ -59,6 +59,11 @@ class OffsetEntry final {
|
||||
uint32_t EndOffsetInTextInBlock() const {
|
||||
return mOffsetInTextInBlock + mLength;
|
||||
}
|
||||
bool OffsetInTextInBlockIsInRangeOrEndOffset(
|
||||
uint32_t aOffsetInTextInBlock) const {
|
||||
return aOffsetInTextInBlock >= mOffsetInTextInBlock &&
|
||||
aOffsetInTextInBlock <= EndOffsetInTextInBlock();
|
||||
}
|
||||
|
||||
OwningNonNull<Text> mTextNode;
|
||||
uint32_t mOffsetInTextNode;
|
||||
@ -1676,8 +1681,7 @@ nsresult TextServicesDocument::SetSelectionInternal(uint32_t aOffset,
|
||||
endTextNode = entry->mTextNode;
|
||||
endNodeOffset = entry->EndOffsetInTextNode();
|
||||
}
|
||||
} else if (endOffset >= entry->mOffsetInTextInBlock &&
|
||||
endOffset <= entry->EndOffsetInTextInBlock()) {
|
||||
} else if (entry->OffsetInTextInBlockIsInRangeOrEndOffset(endOffset)) {
|
||||
endTextNode = entry->mTextNode;
|
||||
endNodeOffset =
|
||||
entry->mOffsetInTextNode + endOffset - entry->mOffsetInTextInBlock;
|
||||
|
Loading…
Reference in New Issue
Block a user