Bug 1700051: part 2) Add GetNoCheckRange() to mozInlineSpellStatus. r=smaug

Depends on D109308

Differential Revision: https://phabricator.services.mozilla.com/D109309
This commit is contained in:
Mirko Brodesser 2021-03-24 10:11:59 +00:00
parent 3691a72cd6
commit 77b3add57e
2 changed files with 7 additions and 3 deletions

View File

@ -1389,8 +1389,9 @@ nsresult mozInlineSpellChecker::DoSpellCheck(
// We do a simple check to see if the beginning of our word is in the
// exclusion range. Because the exclusion range is a multiple of a word,
// this is sufficient.
if (aStatus->mNoCheckRange &&
aStatus->mNoCheckRange->IsPointInRange(*beginNode, beginOffset, erv)) {
if (aStatus->GetNoCheckRange() &&
aStatus->GetNoCheckRange()->IsPointInRange(*beginNode, beginOffset,
erv)) {
continue;
}

View File

@ -73,10 +73,13 @@ class mozInlineSpellStatus {
// hurt)
RefPtr<nsRange> mCreatedRange;
// See `mNoCheckRange`.
const nsRange* GetNoCheckRange() const { return mNoCheckRange; }
private:
// Contains the range computed for the current word. Can be nullptr.
RefPtr<nsRange> mNoCheckRange;
private:
// Indicates the position of the cursor for the event (so we can compute
// mNoCheckRange). It can be nullptr if we don't care about the cursor
// position (such as for the intial check of everything).