| 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, 2013 Apple Inc. All rights reserved. | 5 * Copyright (C) 2007, 2009, 2013 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return genericParseNumber(ptr, end, number, mode); | 154 return genericParseNumber(ptr, end, number, mode); |
| 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 template <typename CharType> | 159 template <typename CharType> |
| 160 bool genericParseArcFlag(const CharType*& ptr, const CharType* end, bool& flag) | 160 bool genericParseArcFlag(const CharType*& ptr, const CharType* end, bool& flag) |
| 161 { | 161 { |
| 162 if (ptr >= end) | 162 if (ptr >= end) |
| 163 return false; | 163 return false; |
| 164 const CharType flagChar = *ptr++; | 164 const CharType flagChar = *ptr; |
| 165 if (flagChar == '0') | 165 if (flagChar == '0') |
| 166 flag = false; | 166 flag = false; |
| 167 else if (flagChar == '1') | 167 else if (flagChar == '1') |
| 168 flag = true; | 168 flag = true; |
| 169 else | 169 else |
| 170 return false; | 170 return false; |
| 171 | 171 |
| 172 ptr++; |
| 172 skipOptionalSVGSpacesOrDelimiter(ptr, end); | 173 skipOptionalSVGSpacesOrDelimiter(ptr, end); |
| 173 | 174 |
| 174 return true; | 175 return true; |
| 175 } | 176 } |
| 176 | 177 |
| 177 bool parseArcFlag(const LChar*& ptr, const LChar* end, bool& flag) | 178 bool parseArcFlag(const LChar*& ptr, const LChar* end, bool& flag) |
| 178 { | 179 { |
| 179 return genericParseArcFlag(ptr, end, flag); | 180 return genericParseArcFlag(ptr, end, flag); |
| 180 } | 181 } |
| 181 | 182 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 const LChar* ptr = string.characters8(); | 245 const LChar* ptr = string.characters8(); |
| 245 const LChar* end = ptr + string.length(); | 246 const LChar* end = ptr + string.length(); |
| 246 return genericParseNumberOrPercentage(ptr, end, number); | 247 return genericParseNumberOrPercentage(ptr, end, number); |
| 247 } | 248 } |
| 248 const UChar* ptr = string.characters16(); | 249 const UChar* ptr = string.characters16(); |
| 249 const UChar* end = ptr + string.length(); | 250 const UChar* end = ptr + string.length(); |
| 250 return genericParseNumberOrPercentage(ptr, end, number); | 251 return genericParseNumberOrPercentage(ptr, end, number); |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |