From 9364f22aed35e1a1e9d07c121510f80be3ab0502 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 21 Oct 2008 07:00:00 -0700 Subject: Initial Contribution --- WebCore/editing/TextIterator.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'WebCore/editing/TextIterator.cpp') diff --git a/WebCore/editing/TextIterator.cpp b/WebCore/editing/TextIterator.cpp index 233361e..c6f1928 100644 --- a/WebCore/editing/TextIterator.cpp +++ b/WebCore/editing/TextIterator.cpp @@ -962,17 +962,17 @@ void CharacterIterator::advance(int count) m_runOffset = 0; } -String CharacterIterator::string(int numChars) +DeprecatedString CharacterIterator::string(int numChars) { - Vector result; - result.reserveCapacity(numChars); + DeprecatedString result; + result.reserve(numChars); while (numChars > 0 && !atEnd()) { int runSize = min(numChars, length()); - result.append(characters(), runSize); + result.append(reinterpret_cast(characters()), runSize); numChars -= runSize; advance(runSize); } - return String::adopt(result); + return result; } // -------- @@ -1001,7 +1001,7 @@ WordAwareIterator::WordAwareIterator(const Range *r) void WordAwareIterator::advance() { m_previousText = 0; - m_buffer.clear(); // toss any old buffer we built up + m_buffer = ""; // toss any old buffer we built up // If last time we did a look-ahead, start with that looked-ahead chunk now if (!m_didLookAhead) { @@ -1038,10 +1038,10 @@ void WordAwareIterator::advance() if (m_buffer.isEmpty()) { // Start gobbling chunks until we get to a suitable stopping point - m_buffer.append(m_previousText, m_previousLength); + m_buffer.append(reinterpret_cast(m_previousText), m_previousLength); m_previousText = 0; } - m_buffer.append(m_textIterator.characters(), m_textIterator.length()); + m_buffer.append(reinterpret_cast(m_textIterator.characters()), m_textIterator.length()); int exception = 0; m_range->setEnd(m_textIterator.range()->endContainer(exception), m_textIterator.range()->endOffset(exception), exception); } @@ -1050,7 +1050,7 @@ void WordAwareIterator::advance() int WordAwareIterator::length() const { if (!m_buffer.isEmpty()) - return m_buffer.size(); + return m_buffer.length(); if (m_previousText) return m_previousLength; return m_textIterator.length(); @@ -1059,7 +1059,7 @@ int WordAwareIterator::length() const const UChar* WordAwareIterator::characters() const { if (!m_buffer.isEmpty()) - return m_buffer.data(); + return reinterpret_cast(m_buffer.unicode()); if (m_previousText) return m_previousText; return m_textIterator.characters(); -- cgit v1.1