OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2002, 2003 The Karbon Developers | 2 * Copyright (C) 2002, 2003 The Karbon Developers |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> |
5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 { | 151 { |
152 const UChar* ptr = string.characters(); | 152 const UChar* ptr = string.characters(); |
153 const UChar* end = ptr + string.length(); | 153 const UChar* end = ptr + string.length(); |
154 return genericParseNumber(ptr, end, number, skip) && ptr == end; | 154 return genericParseNumber(ptr, end, number, skip) && ptr == end; |
155 } | 155 } |
156 | 156 |
157 // only used to parse largeArcFlag and sweepFlag which must be a "0" or "1" | 157 // only used to parse largeArcFlag and sweepFlag which must be a "0" or "1" |
158 // and might not have any whitespace/comma after it | 158 // and might not have any whitespace/comma after it |
159 bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag) | 159 bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag) |
160 { | 160 { |
| 161 if (ptr >= end) |
| 162 return false; |
161 const UChar flagChar = *ptr++; | 163 const UChar flagChar = *ptr++; |
162 if (flagChar == '0') | 164 if (flagChar == '0') |
163 flag = false; | 165 flag = false; |
164 else if (flagChar == '1') | 166 else if (flagChar == '1') |
165 flag = true; | 167 flag = true; |
166 else | 168 else |
167 return false; | 169 return false; |
168 | 170 |
169 skipOptionalSVGSpacesOrDelimiter(ptr, end); | 171 skipOptionalSVGSpacesOrDelimiter(ptr, end); |
170 | 172 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 values.append(String(inputStart, inputEnd - inputStart + 1)); | 389 values.append(String(inputStart, inputEnd - inputStart + 1)); |
388 skipOptionalSVGSpacesOrDelimiter(ptr, end, seperator); | 390 skipOptionalSVGSpacesOrDelimiter(ptr, end, seperator); |
389 } | 391 } |
390 | 392 |
391 return values; | 393 return values; |
392 } | 394 } |
393 | 395 |
394 } | 396 } |
395 | 397 |
396 #endif // ENABLE(SVG) | 398 #endif // ENABLE(SVG) |
OLD | NEW |