Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1041)

Unified Diff: Source/core/editing/spellcheck/TextCheckingHelper.cpp

Issue 1317053004: Make VisiblePosition constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-02T12:44:47 Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/spellcheck/SpellChecker.cpp ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/spellcheck/TextCheckingHelper.cpp
diff --git a/Source/core/editing/spellcheck/TextCheckingHelper.cpp b/Source/core/editing/spellcheck/TextCheckingHelper.cpp
index 8640c0578f3044c81763e9c058e4a1d39313ff48..ede8e89051d753aef1a661c68875df45601cc79e 100644
--- a/Source/core/editing/spellcheck/TextCheckingHelper.cpp
+++ b/Source/core/editing/spellcheck/TextCheckingHelper.cpp
@@ -101,15 +101,15 @@ static void findMisspellings(TextCheckerClient& client, const UChar* text, int s
void expandRangeToSentenceBoundary(Range& range)
{
- range.setStart(startOfSentence(VisiblePosition(range.startPosition())).deepEquivalent());
- range.setEnd(endOfSentence(VisiblePosition(range.endPosition())).deepEquivalent());
+ range.setStart(startOfSentence(createVisiblePosition(range.startPosition())).deepEquivalent());
+ range.setEnd(endOfSentence(createVisiblePosition(range.endPosition())).deepEquivalent());
}
static PassRefPtrWillBeRawPtr<Range> expandToParagraphBoundary(PassRefPtrWillBeRawPtr<Range> range)
{
RefPtrWillBeRawPtr<Range> paragraphRange = range->cloneRange();
- paragraphRange->setStart(startOfParagraph(VisiblePosition(range->startPosition())).deepEquivalent());
- paragraphRange->setEnd(endOfParagraph(VisiblePosition(range->endPosition())).deepEquivalent());
+ paragraphRange->setStart(startOfParagraph(createVisiblePosition(range->startPosition())).deepEquivalent());
+ paragraphRange->setEnd(endOfParagraph(createVisiblePosition(range->endPosition())).deepEquivalent());
return paragraphRange;
}
@@ -137,7 +137,7 @@ TextCheckingParagraph::~TextCheckingParagraph()
void TextCheckingParagraph::expandRangeToNextEnd()
{
ASSERT(m_checkingRange);
- paragraphRange()->setEnd(endOfParagraph(startOfNextParagraph(VisiblePosition(paragraphRange()->startPosition()))).deepEquivalent());
+ paragraphRange()->setEnd(endOfParagraph(startOfNextParagraph(createVisiblePosition(paragraphRange()->startPosition()))).deepEquivalent());
invalidateParagraphRangeValues();
}
@@ -313,10 +313,10 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b
// Expand the search range to encompass entire paragraphs, since text checking needs that much context.
// Determine the character offset from the start of the paragraph to the start of the original search range,
// since we will want to ignore results in this area.
- Position paragraphStart = startOfParagraph(VisiblePosition(m_start)).toParentAnchoredPosition();
+ Position paragraphStart = startOfParagraph(createVisiblePosition(m_start)).toParentAnchoredPosition();
Position paragraphEnd = m_end;
int totalRangeLength = TextIterator::rangeLength(paragraphStart, paragraphEnd);
- paragraphEnd = endOfParagraph(VisiblePosition(m_start)).toParentAnchoredPosition();
+ paragraphEnd = endOfParagraph(createVisiblePosition(m_start)).toParentAnchoredPosition();
int rangeStartOffset = TextIterator::rangeLength(paragraphStart, m_start);
int totalLengthProcessed = 0;
@@ -328,7 +328,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b
int currentLength = TextIterator::rangeLength(paragraphStart, paragraphEnd);
int currentStartOffset = firstIteration ? rangeStartOffset : 0;
int currentEndOffset = currentLength;
- if (inSameParagraph(VisiblePosition(paragraphStart), VisiblePosition(m_end))) {
+ if (inSameParagraph(createVisiblePosition(paragraphStart), createVisiblePosition(m_end))) {
// 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.
currentEndOffset = TextIterator::rangeLength(paragraphStart, m_end);
@@ -402,7 +402,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b
}
if (lastIteration || totalLengthProcessed + currentLength >= totalRangeLength)
break;
- VisiblePosition newParagraphStart = startOfNextParagraph(VisiblePosition(paragraphEnd));
+ VisiblePosition newParagraphStart = startOfNextParagraph(createVisiblePosition(paragraphEnd));
paragraphStart = newParagraphStart.toParentAnchoredPosition();
paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition();
firstIteration = false;
« no previous file with comments | « Source/core/editing/spellcheck/SpellChecker.cpp ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698