Index: Source/core/editing/TextCheckingHelper.cpp |
diff --git a/Source/core/editing/TextCheckingHelper.cpp b/Source/core/editing/TextCheckingHelper.cpp |
index 63aae0c0e28cb6660a562f456f734f5145477b56..33471b3344e82a97f8d8645b322b6558efee70d0 100644 |
--- a/Source/core/editing/TextCheckingHelper.cpp |
+++ b/Source/core/editing/TextCheckingHelper.cpp |
@@ -181,7 +181,7 @@ PassRefPtr<Range> TextCheckingParagraph::offsetAsRange() const |
{ |
ASSERT(m_checkingRange); |
if (!m_offsetAsRange) |
- m_offsetAsRange = Range::create(¶graphRange()->startContainer()->document(), paragraphRange()->startPosition(), checkingRange()->startPosition()); |
+ m_offsetAsRange = Range::create(paragraphRange()->startContainer()->document(), paragraphRange()->startPosition(), checkingRange()->startPosition()); |
return m_offsetAsRange; |
} |
@@ -310,7 +310,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b |
int totalRangeLength = TextIterator::rangeLength(paragraphRange.get()); |
setEnd(paragraphRange.get(), endOfParagraph(m_range->startPosition())); |
- RefPtr<Range> offsetAsRange = Range::create(¶graphRange->startContainer()->document(), paragraphRange->startPosition(), m_range->startPosition()); |
+ RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer()->document(), paragraphRange->startPosition(), m_range->startPosition()); |
int rangeStartOffset = TextIterator::rangeLength(offsetAsRange.get()); |
int totalLengthProcessed = 0; |
@@ -324,7 +324,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b |
if (inSameParagraph(paragraphRange->startPosition(), m_range->endPosition())) { |
// Determine the character offset from the end of the original search range to the end of the paragraph, |
// since we will want to ignore results in this area. |
- RefPtr<Range> endOffsetAsRange = Range::create(¶graphRange->startContainer()->document(), paragraphRange->startPosition(), m_range->endPosition()); |
+ RefPtr<Range> endOffsetAsRange = Range::create(paragraphRange->startContainer()->document(), paragraphRange->startPosition(), m_range->endPosition()); |
currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.get()); |
lastIteration = true; |
} |
@@ -377,7 +377,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b |
if (!misspelledWord.isEmpty() && (!checkGrammar || badGrammarPhrase.isEmpty() || spellingLocation <= grammarDetailLocation)) { |
int spellingOffset = spellingLocation - currentStartOffset; |
if (!firstIteration) { |
- RefPtr<Range> paragraphOffsetAsRange = Range::create(¶graphRange->startContainer()->document(), m_range->startPosition(), paragraphRange->startPosition()); |
+ RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer()->document(), m_range->startPosition(), paragraphRange->startPosition()); |
spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get()); |
} |
outIsSpelling = true; |
@@ -388,7 +388,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b |
if (checkGrammar && !badGrammarPhrase.isEmpty()) { |
int grammarPhraseOffset = grammarPhraseLocation - currentStartOffset; |
if (!firstIteration) { |
- RefPtr<Range> paragraphOffsetAsRange = Range::create(¶graphRange->startContainer()->document(), m_range->startPosition(), paragraphRange->startPosition()); |
+ RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer()->document(), m_range->startPosition(), paragraphRange->startPosition()); |
grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get()); |
} |
outIsSpelling = false; |
@@ -525,11 +525,8 @@ bool TextCheckingHelper::unifiedTextCheckerEnabled() const |
if (!m_range) |
return false; |
- Document* doc = m_range->ownerDocument(); |
- if (!doc) |
- return false; |
- |
- return WebCore::unifiedTextCheckerEnabled(doc->frame()); |
+ Document& doc = m_range->ownerDocument(); |
+ return WebCore::unifiedTextCheckerEnabled(doc.frame()); |
} |
void checkTextOfParagraph(TextCheckerClient& client, const String& text, TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results) |