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

Commit fccd37fb authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Spans should be preserved in TextInfo whenever possible

This is a follow up CL for Ib58ece68dee4c6187d469049fca8c3.

Now SpellCheckerService is expected to store span information
in TextInfo whenever possible so that spell checker service
can use it later.

BUG: 15869548
Change-Id: I481a2efe359de6162ebe095f60506aba3db3d762
parent eea0b8b0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -383,8 +383,9 @@ public abstract class SpellCheckerService extends Service {
            while (wordStart <= end && wordEnd != BreakIterator.DONE
                    && wordStart != BreakIterator.DONE) {
                if (wordEnd >= start && wordEnd > wordStart) {
                    final String query = originalText.subSequence(wordStart, wordEnd).toString();
                    final TextInfo ti = new TextInfo(query, cookie, query.hashCode());
                    final CharSequence query = originalText.subSequence(wordStart, wordEnd);
                    final TextInfo ti = new TextInfo(query, 0, query.length(), cookie,
                            query.hashCode());
                    wordItems.add(new SentenceWordItem(ti, wordStart, wordEnd));
                    if (DBG) {
                        Log.d(TAG, "Adapter: word (" + (wordItems.size() - 1) + ") " + query);