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

Unified Diff: Source/core/editing/SpellChecker.cpp

Issue 565613002: Remove usages of temporary Range objects that end up registered on the (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/dom/DocumentMarkerController.cpp ('k') | Source/core/editing/TextIterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/SpellChecker.cpp
diff --git a/Source/core/editing/SpellChecker.cpp b/Source/core/editing/SpellChecker.cpp
index c6caf4abeb44a6cccd9eb524fa96df4ad2dc5278..1d869b877be2dd4e79864a9402922adb4f07b887 100644
--- a/Source/core/editing/SpellChecker.cpp
+++ b/Source/core/editing/SpellChecker.cpp
@@ -803,12 +803,14 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio
// shouldEraseMarkersAfterChangeSelection is true, we cause synchronous
// layout.
if (textChecker().shouldEraseMarkersAfterChangeSelection(TextCheckingTypeSpelling)) {
- if (RefPtrWillBeRawPtr<Range> wordRange = newAdjacentWords.toNormalizedRange())
- m_frame.document()->markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling);
+ Position start, end;
+ if (newAdjacentWords.toNormalizedPositions(start, end))
+ m_frame.document()->markers().removeMarkers(start, end, DocumentMarker::Spelling);
}
if (textChecker().shouldEraseMarkersAfterChangeSelection(TextCheckingTypeGrammar)) {
- if (RefPtrWillBeRawPtr<Range> sentenceRange = newSelectedSentence.toNormalizedRange())
- m_frame.document()->markers().removeMarkers(sentenceRange.get(), DocumentMarker::Grammar);
+ Position start, end;
+ if (newSelectedSentence.toNormalizedPositions(start, end))
+ m_frame.document()->markers().removeMarkers(start, end, DocumentMarker::Grammar);
}
}
« no previous file with comments | « Source/core/dom/DocumentMarkerController.cpp ('k') | Source/core/editing/TextIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698