Searched defs:misspellingLocation (Results 1 - 2 of 2) sorted by relevance

/external/chromium_org/third_party/WebKit/Source/web/
H A DSpellCheckerClientImpl.cpp129 void SpellCheckerClientImpl::checkSpellingOfString(const String& text, int* misspellingLocation, int* misspellingLength) argument
146 if (misspellingLocation)
147 *misspellingLocation = spellLocation;
/external/chromium_org/third_party/WebKit/Source/core/editing/
H A DTextCheckingHelper.cpp83 int misspellingLocation = -1; local
85 client.checkSpellingOfString(String(text + start + wordStart, wordLength), &misspellingLocation, &misspellingLength);
87 ASSERT(0 <= misspellingLocation && misspellingLocation <= wordLength);
88 ASSERT(0 < misspellingLength && misspellingLocation + misspellingLength <= wordLength);
91 misspelling.location = start + wordStart + misspellingLocation;
247 int misspellingLocation = -1; local
249 m_client->textChecker().checkSpellingOfString(it.substring(0, length), &misspellingLocation, &misspellingLength);
255 ASSERT(misspellingLocation >= -1);
256 ASSERT(!misspellingLength || misspellingLocation >
257 ASSERT(misspellingLocation < length); ASSERT(misspellingLength <= length); ASSERT(misspellingLocation + misspellingLength <= length); if (misspellingLocation >= 0 && misspellingLength > 0 && misspellingLocation < length && misspellingLength <= length && misspellingLocation + misspellingLength <= length) { Position misspellingStart = m_start; Position misspellingEnd = m_end; TextIterator::subrange(misspellingStart, misspellingEnd, currentChunkOffset + misspellingLocation, misspellingLength); if (!firstMisspelling) { firstMisspellingOffset = currentChunkOffset + misspellingLocation; firstMisspelling = it.substring(misspellingLocation, misspellingLength); firstMisspellingRange = Range::create(misspellingStart.containerNode()->document(), m_start, m_end); } misspellingStart.containerNode()->document().markers().addMarker(misspellingStart, misspellingEnd, DocumentMarker::Spelling); if (!markAll) break; } } currentChunkOffset += length; it.advance(); } return firstMisspelling; } String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail) { if (!unifiedTextCheckerEnabled()) return �; String firstFoundItem; String misspelledWord; String badGrammarPhrase; outIsSpelling = true; outFirstFoundOffset = 0; outGrammarDetail.location = -1; outGrammarDetail.length = 0; outGrammarDetail.guesses.clear(); outGrammarDetail.userDescription = �; Position paragraphStart = startOfParagraph(VisiblePosition(m_start)).toParentAnchoredPosition(); Position paragraphEnd = m_end; int totalRangeLength = TextIterator::rangeLength(paragraphStart, paragraphEnd); paragraphEnd = endOfParagraph(VisiblePosition(m_start)).toParentAnchoredPosition(); int rangeStartOffset = TextIterator::rangeLength(paragraphStart, m_start); int totalLengthProcessed = 0; bool firstIteration = true; bool lastIteration = false; while (totalLengthProcessed < totalRangeLength) { int currentLength = TextIterator::rangeLength(paragraphStart, paragraphEnd); int currentStartOffset = firstIteration ? rangeStartOffset : 0; int currentEndOffset = currentLength; if (inSameParagraph(VisiblePosition(paragraphStart), VisiblePosition(m_end))) { currentEndOffset = TextIterator::rangeLength(paragraphStart, m_end); lastIteration = true; } if (currentStartOffset < currentEndOffset) { String paragraphString = plainText(paragraphStart, paragraphEnd); if (paragraphString.length() > 0) { bool foundGrammar = false; int spellingLocation = 0; int grammarPhraseLocation = 0; int grammarDetailLocation = 0; unsigned grammarDetailIndex = 0; Vector<TextCheckingResult> results; TextCheckingTypeMask checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling; checkTextOfParagraph(m_client->textChecker(), paragraphString, checkingTypes, results); for (unsigned i = 0; i < results.size(); i++) { const TextCheckingResult* result = &results[i]; if (result->decoration == TextDecorationTypeSpelling && result->location >= currentStartOffset && result->location + result->length <= currentEndOffset) argument
[all...]

Completed in 765 milliseconds