summaryrefslogtreecommitdiffstats
path: root/WebCore/editing/TextIterator.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/editing/TextIterator.cpp
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/editing/TextIterator.cpp')
-rw-r--r--WebCore/editing/TextIterator.cpp20
1 files changed, 10 insertions, 10 deletions
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<UChar> 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<const DeprecatedChar*>(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<const DeprecatedChar*>(m_previousText), m_previousLength);
m_previousText = 0;
}
- m_buffer.append(m_textIterator.characters(), m_textIterator.length());
+ m_buffer.append(reinterpret_cast<const DeprecatedChar*>(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<const UChar*>(m_buffer.unicode());
if (m_previousText)
return m_previousText;
return m_textIterator.characters();