Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1a22db29 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

IOOB in text selection.

Several issues here:

1. when selection has been set to size 0 (should not be possible, but see 2.),
moving any of the selection handles will create an IOOB because we add/substract 1
with no test. Added min/max.

2. the text change detection, which stop selection mode, was done in
handleTextChanged. We need to go deeper. Some methods (such as setText())
directly call the more atomic sendOnTextChange(). Moved the test down
to this method. As a result, pressing the 'x' button in the QuickSearchBox
correctly stops selection mode (it used to leave an empty selection).

This change may also solve some weird similar issues in extracted mode where
it is sometimes possible to end up with a 0-length selection.

It may also impact Bug 5555929 since spellCheckSpans will now be correctly
updated on ANY text change.

3. the before != after test is flawed. When this method is called, the text
has been changed and selection mode should be stopped even when the new text
happens to have the same size.

Change-Id: I869ef728662f4350f22ed6149dd42db193c333ed
parent b90a70d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment