OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 String SVGStringList::getItem(size_t index, ExceptionState& exceptionState) { | 41 String SVGStringList::getItem(size_t index, ExceptionState& exceptionState) { |
42 if (!checkIndexBound(index, exceptionState)) | 42 if (!checkIndexBound(index, exceptionState)) |
43 return String(); | 43 return String(); |
44 | 44 |
45 return m_values.at(index); | 45 return m_values.at(index); |
46 } | 46 } |
47 | 47 |
48 void SVGStringList::insertItemBefore(const String& newItem, size_t index) { | 48 void SVGStringList::insertItemBefore(const String& newItem, size_t index) { |
49 // Spec: If the index is greater than or equal to numberOfItems, then the new
item is appended to the end of the list. | 49 // Spec: If the index is greater than or equal to numberOfItems, then the new |
| 50 // item is appended to the end of the list. |
50 if (index > m_values.size()) | 51 if (index > m_values.size()) |
51 index = m_values.size(); | 52 index = m_values.size(); |
52 | 53 |
53 // Spec: Inserts a new item into the list at the specified position. The index
of the item before which the new item is to be | 54 // Spec: Inserts a new item into the list at the specified position. The index |
54 // inserted. The first item is number 0. If the index is equal to 0, then the
new item is inserted at the front of the list. | 55 // of the item before which the new item is to be inserted. The first item is |
| 56 // number 0. If the index is equal to 0, then the new item is inserted at the |
| 57 // front of the list. |
55 m_values.insert(index, newItem); | 58 m_values.insert(index, newItem); |
56 } | 59 } |
57 | 60 |
58 String SVGStringList::removeItem(size_t index, ExceptionState& exceptionState) { | 61 String SVGStringList::removeItem(size_t index, ExceptionState& exceptionState) { |
59 if (!checkIndexBound(index, exceptionState)) | 62 if (!checkIndexBound(index, exceptionState)) |
60 return String(); | 63 return String(); |
61 | 64 |
62 String oldItem = m_values.at(index); | 65 String oldItem = m_values.at(index); |
63 m_values.remove(index); | 66 m_values.remove(index); |
64 return oldItem; | 67 return oldItem; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 162 } |
160 | 163 |
161 float SVGStringList::calculateDistance(SVGPropertyBase*, SVGElement*) { | 164 float SVGStringList::calculateDistance(SVGPropertyBase*, SVGElement*) { |
162 // SVGStringList is never animated. | 165 // SVGStringList is never animated. |
163 ASSERT_NOT_REACHED(); | 166 ASSERT_NOT_REACHED(); |
164 | 167 |
165 return -1.0f; | 168 return -1.0f; |
166 } | 169 } |
167 | 170 |
168 } // namespace blink | 171 } // namespace blink |
OLD | NEW |