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

/external/chromium_org/third_party/WebKit/Source/core/editing/
H A DTextCheckingHelper.cpp326 if (inSameParagraph(VisiblePosition(paragraphStart), VisiblePosition(m_end))) {
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
H A DVisibleUnits.cpp1246 bool inSameParagraph(const VisiblePosition &a, const VisiblePosition &b, EditingBoundaryCrossingRule boundaryCrossingRule) function in namespace:blink
1269 } while (inSameParagraph(p, pos));
1281 } while (inSameParagraph(p, pos));

Completed in 166 milliseconds