Changeset 13244 in webkit
- Timestamp:
- Mar 9, 2006 6:20:26 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r13241 r13244 1 2006-03-09 Adele Peterson <adele@apple.com> 2 3 Reviewed by Tim O. 4 5 Removed unnecessary alerts in TextIterator advance methods. 6 We want to be able to use advance() even if the iterator is already at the end. 7 8 * editing/visible_text.cpp: 9 (khtml::TextIterator::advance): remove assert since TextIterator will just do nothing if its already at the end. 10 (khtml::CharacterIterator::advance): ditto. 11 * rendering/RenderTextField.cpp: (WebCore::RenderTextField::visiblePositionForIndex): 12 Since the asserts in the iterator are removed, we don't have to check for it.atEnd() before calling advance. 13 1 14 2006-03-09 David Hyatt <hyatt@apple.com> 2 15 -
trunk/WebCore/editing/visible_text.cpp
r13167 r13244 131 131 void TextIterator::advance() 132 132 { 133 // otherwise, where are we advancing from?134 assert(m_positionNode);135 136 133 // reset the run information 137 134 m_positionNode = 0; … … 757 754 void CharacterIterator::advance(int count) 758 755 { 759 assert(!atEnd());760 761 756 m_atBreak = false; 762 757 -
trunk/WebCore/rendering/RenderTextField.cpp
r13240 r13244 178 178 { 179 179 if (index <= 0) 180 return VisiblePosition(m_div.get(), 0, DOWNSTREAM);180 return VisiblePosition(m_div.get(), 0, UPSTREAM); 181 181 ExceptionCode ec = 0; 182 182 RefPtr<RangeImpl> range = new RangeImpl(document()); 183 183 range->selectNodeContents(m_div.get(), ec); 184 184 CharacterIterator it(range.get()); 185 if (!it.atEnd()) 186 it.advance(index - 1); 185 it.advance(index - 1); 187 186 return VisiblePosition(it.range()->endContainer(ec), it.range()->endOffset(ec), UPSTREAM); 188 187 }
Note: See TracChangeset
for help on using the changeset viewer.