diff options
-rw-r--r-- | Source/WebCore/platform/text/SegmentedString.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/WebCore/platform/text/SegmentedString.cpp b/Source/WebCore/platform/text/SegmentedString.cpp index b0dc3d3dd..95de06ae4 100644 --- a/Source/WebCore/platform/text/SegmentedString.cpp +++ b/Source/WebCore/platform/text/SegmentedString.cpp @@ -166,7 +166,14 @@ void SegmentedString::close() void SegmentedString::append(const SegmentedString& s) { ASSERT(!m_closed); - ASSERT(!s.escaped()); + if (s.m_pushedChar1) { + Vector<UChar, 2> unconsumedData; + unconsumedData.append(s.m_pushedChar1); + if (s.m_pushedChar2) + unconsumedData.append(s.m_pushedChar2); + append(SegmentedSubstring(String(unconsumedData))); + } + append(s.m_currentString); if (s.isComposite()) { Deque<SegmentedSubstring>::const_iterator it = s.m_substrings.begin(); @@ -174,7 +181,7 @@ void SegmentedString::append(const SegmentedString& s) for (; it != e; ++it) append(*it); } - m_currentChar = m_pushedChar1 ? m_pushedChar1 : (m_currentString.m_length ? m_currentString.getCurrentChar() : 0); + m_currentChar = m_currentString.m_length ? m_currentString.getCurrentChar() : 0; } void SegmentedString::prepend(const SegmentedString& s) |