Changeset 181072 in webkit
- Timestamp:
- Mar 5, 2015 12:56:22 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181069 r181072 1 2015-03-05 Grzegorz Czajkowski <g.czajkowski@samsung.com> 2 3 TextCheckingParagraph::isEmpty() is sufficient to check whether paragraph is empty 4 https://bugs.webkit.org/show_bug.cgi?id=142276 5 6 Reviewed by Darin Adler. 7 8 TextCheckingParagraph::isEmpty() already calls TextCheckingParagraph::isRangeEmpty(). 9 There is no need to call them both at the caller site. 10 11 No new tests. No behavior change. 12 13 * editing/Editor.cpp: 14 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): 15 Update caller site. 16 17 * editing/TextCheckingHelper.cpp: 18 (WebCore::TextCheckingParagraph::isEmpty): 19 Avoid using helepers here to get rid of them as they are 20 no longer needed outside TextCheckingParagraph. 21 22 * editing/TextCheckingHelper.h: 23 (WebCore::TextCheckingParagraph::isTextEmpty): Deleted. 24 (WebCore::TextCheckingParagraph::isRangeEmpty): Deleted. 25 Do not expose isTextEmpty() and isRangeEmpty(). 26 1 27 2015-03-04 Simon Fraser <simon.fraser@apple.com> 2 28 -
trunk/Source/WebCore/editing/Editor.cpp
r179758 r181072 2353 2353 Range* rangeToCheck = shouldMarkGrammar ? grammarRange : spellingRange; 2354 2354 TextCheckingParagraph paragraphToCheck(rangeToCheck); 2355 if (paragraphToCheck.is RangeEmpty() || paragraphToCheck.isEmpty())2355 if (paragraphToCheck.isEmpty()) 2356 2356 return; 2357 2357 RefPtr<Range> paragraphRange = paragraphToCheck.paragraphRange(); -
trunk/Source/WebCore/editing/TextCheckingHelper.cpp
r173235 r181072 185 185 // Both predicates should have same result, but we check both just for sure. 186 186 // We need to investigate to remove this redundancy. 187 return isRangeEmpty() || isTextEmpty();187 return checkingStart() >= checkingEnd() || text().isEmpty(); 188 188 } 189 189 -
trunk/Source/WebCore/editing/TextCheckingHelper.h
r163712 r181072 51 51 String textSubstring(unsigned pos, unsigned len = UINT_MAX) const { return text().substring(pos, len); } 52 52 UChar textCharAt(int index) const { return text()[static_cast<unsigned>(index)]; } 53 bool isTextEmpty() const { return text().isEmpty(); }54 53 55 54 bool isEmpty() const; 56 bool isRangeEmpty() const { return checkingStart() >= checkingEnd(); }57 55 58 56 int checkingStart() const;
Note: See TracChangeset
for help on using the changeset viewer.