OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return; | 239 return; |
240 | 240 |
241 float convertedNumber = 0; | 241 float convertedNumber = 0; |
242 SVGLengthType type = LengthTypeUnknown; | 242 SVGLengthType type = LengthTypeUnknown; |
243 | 243 |
244 bool success = string.is8Bit() ? | 244 bool success = string.is8Bit() ? |
245 parseValueInternal<LChar>(string, convertedNumber, type) : | 245 parseValueInternal<LChar>(string, convertedNumber, type) : |
246 parseValueInternal<UChar>(string, convertedNumber, type); | 246 parseValueInternal<UChar>(string, convertedNumber, type); |
247 | 247 |
248 if (!success) { | 248 if (!success) { |
249 ec = SYNTAX_ERR; | 249 ec = SyntaxError; |
250 return; | 250 return; |
251 } | 251 } |
252 | 252 |
253 m_unit = storeUnit(extractMode(m_unit), type); | 253 m_unit = storeUnit(extractMode(m_unit), type); |
254 m_valueInSpecifiedUnits = convertedNumber; | 254 m_valueInSpecifiedUnits = convertedNumber; |
255 } | 255 } |
256 | 256 |
257 String SVGLength::valueAsString() const | 257 String SVGLength::valueAsString() const |
258 { | 258 { |
259 return String::number(m_valueInSpecifiedUnits) + lengthTypeToString(extractT
ype(m_unit)); | 259 return String::number(m_valueInSpecifiedUnits) + lengthTypeToString(extractT
ype(m_unit)); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 s_lengthModeMap.set(SVGNames::startOffsetAttr, LengthModeWidth); | 415 s_lengthModeMap.set(SVGNames::startOffsetAttr, LengthModeWidth); |
416 } | 416 } |
417 | 417 |
418 if (s_lengthModeMap.contains(attrName)) | 418 if (s_lengthModeMap.contains(attrName)) |
419 return s_lengthModeMap.get(attrName); | 419 return s_lengthModeMap.get(attrName); |
420 | 420 |
421 return LengthModeOther; | 421 return LengthModeOther; |
422 } | 422 } |
423 | 423 |
424 } | 424 } |
OLD | NEW |