| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (offsetCount.hasOverflowed() || offset + count > length) | 118 if (offsetCount.hasOverflowed() || offset + count > length) |
| 119 realCount = length - offset; | 119 realCount = length - offset; |
| 120 else | 120 else |
| 121 realCount = count; | 121 realCount = count; |
| 122 | 122 |
| 123 return true; | 123 return true; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionState&
exceptionState, RecalcStyleBehavior recalcStyleBehavior) | 126 void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionState&
exceptionState, RecalcStyleBehavior recalcStyleBehavior) |
| 127 { | 127 { |
| 128 unsigned realCount; | 128 unsigned realCount = 0; |
| 129 if (!validateOffsetCount(offset, count, length(), realCount, exceptionState)
) | 129 if (!validateOffsetCount(offset, count, length(), realCount, exceptionState)
) |
| 130 return; | 130 return; |
| 131 | 131 |
| 132 String newStr = m_data; | 132 String newStr = m_data; |
| 133 newStr.remove(offset, realCount); | 133 newStr.remove(offset, realCount); |
| 134 | 134 |
| 135 setDataAndUpdate(newStr, offset, realCount, 0, recalcStyleBehavior); | 135 setDataAndUpdate(newStr, offset, realCount, 0, recalcStyleBehavior); |
| 136 | 136 |
| 137 document().didRemoveText(this, offset, realCount); | 137 document().didRemoveText(this, offset, realCount); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void CharacterData::replaceData(unsigned offset, unsigned count, const String& d
ata, ExceptionState& exceptionState) | 140 void CharacterData::replaceData(unsigned offset, unsigned count, const String& d
ata, ExceptionState& exceptionState) |
| 141 { | 141 { |
| 142 unsigned realCount; | 142 unsigned realCount = 0; |
| 143 if (!validateOffsetCount(offset, count, length(), realCount, exceptionState)
) | 143 if (!validateOffsetCount(offset, count, length(), realCount, exceptionState)
) |
| 144 return; | 144 return; |
| 145 | 145 |
| 146 String newStr = m_data; | 146 String newStr = m_data; |
| 147 newStr.remove(offset, realCount); | 147 newStr.remove(offset, realCount); |
| 148 newStr.insert(data, offset); | 148 newStr.insert(data, offset); |
| 149 | 149 |
| 150 setDataAndUpdate(newStr, offset, realCount, data.length()); | 150 setDataAndUpdate(newStr, offset, realCount, data.length()); |
| 151 | 151 |
| 152 // update the markers for spell checking and grammar checking | 152 // update the markers for spell checking and grammar checking |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 { | 208 { |
| 209 return static_cast<int>(length()); | 209 return static_cast<int>(length()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 bool CharacterData::offsetInCharacters() const | 212 bool CharacterData::offsetInCharacters() const |
| 213 { | 213 { |
| 214 return true; | 214 return true; |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace WebCore | 217 } // namespace WebCore |
| OLD | NEW |