| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 115     if (firstChar == 'p' && secondChar == 'c') | 115     if (firstChar == 'p' && secondChar == 'c') | 
| 116         return LengthTypePC; | 116         return LengthTypePC; | 
| 117 | 117 | 
| 118     return LengthTypeUnknown; | 118     return LengthTypeUnknown; | 
| 119 } | 119 } | 
| 120 | 120 | 
| 121 SVGLength::SVGLength(SVGLengthMode mode, const String& valueAsString) | 121 SVGLength::SVGLength(SVGLengthMode mode, const String& valueAsString) | 
| 122     : m_valueInSpecifiedUnits(0) | 122     : m_valueInSpecifiedUnits(0) | 
| 123     , m_unit(storeUnit(mode, LengthTypeNumber)) | 123     , m_unit(storeUnit(mode, LengthTypeNumber)) | 
| 124 { | 124 { | 
| 125     setValueAsString(valueAsString, IGNORE_EXCEPTION_STATE); | 125     setValueAsString(valueAsString, IGNORE_EXCEPTION); | 
| 126 } | 126 } | 
| 127 | 127 | 
| 128 SVGLength::SVGLength(const SVGLengthContext& context, float value, SVGLengthMode
      mode, SVGLengthType unitType) | 128 SVGLength::SVGLength(const SVGLengthContext& context, float value, SVGLengthMode
      mode, SVGLengthType unitType) | 
| 129     : m_valueInSpecifiedUnits(0) | 129     : m_valueInSpecifiedUnits(0) | 
| 130     , m_unit(storeUnit(mode, unitType)) | 130     , m_unit(storeUnit(mode, unitType)) | 
| 131 { | 131 { | 
| 132     setValue(value, context, ASSERT_NO_EXCEPTION_STATE); | 132     setValue(value, context, ASSERT_NO_EXCEPTION); | 
| 133 } | 133 } | 
| 134 | 134 | 
| 135 SVGLength::SVGLength(const SVGLength& other) | 135 SVGLength::SVGLength(const SVGLength& other) | 
| 136     : m_valueInSpecifiedUnits(other.m_valueInSpecifiedUnits) | 136     : m_valueInSpecifiedUnits(other.m_valueInSpecifiedUnits) | 
| 137     , m_unit(other.m_unit) | 137     , m_unit(other.m_unit) | 
| 138 { | 138 { | 
| 139 } | 139 } | 
| 140 | 140 | 
| 141 void SVGLength::setValueAsString(const String& valueAsString, SVGLengthMode mode
     , ExceptionState& es) | 141 void SVGLength::setValueAsString(const String& valueAsString, SVGLengthMode mode
     , ExceptionState& es) | 
| 142 { | 142 { | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 176     return extractType(m_unit); | 176     return extractType(m_unit); | 
| 177 } | 177 } | 
| 178 | 178 | 
| 179 SVGLengthMode SVGLength::unitMode() const | 179 SVGLengthMode SVGLength::unitMode() const | 
| 180 { | 180 { | 
| 181     return extractMode(m_unit); | 181     return extractMode(m_unit); | 
| 182 } | 182 } | 
| 183 | 183 | 
| 184 float SVGLength::value(const SVGLengthContext& context) const | 184 float SVGLength::value(const SVGLengthContext& context) const | 
| 185 { | 185 { | 
| 186     return value(context, IGNORE_EXCEPTION_STATE); | 186     return value(context, IGNORE_EXCEPTION); | 
| 187 } | 187 } | 
| 188 | 188 | 
| 189 float SVGLength::value(const SVGLengthContext& context, ExceptionState& es) cons
     t | 189 float SVGLength::value(const SVGLengthContext& context, ExceptionState& es) cons
     t | 
| 190 { | 190 { | 
| 191     return context.convertValueToUserUnits(m_valueInSpecifiedUnits, extractMode(
     m_unit), extractType(m_unit), es); | 191     return context.convertValueToUserUnits(m_valueInSpecifiedUnits, extractMode(
     m_unit), extractType(m_unit), es); | 
| 192 } | 192 } | 
| 193 | 193 | 
| 194 void SVGLength::setValue(const SVGLengthContext& context, float value, SVGLength
     Mode mode, SVGLengthType unitType, ExceptionState& es) | 194 void SVGLength::setValue(const SVGLengthContext& context, float value, SVGLength
     Mode mode, SVGLengthType unitType, ExceptionState& es) | 
| 195 { | 195 { | 
| 196     m_unit = storeUnit(mode, unitType); | 196     m_unit = storeUnit(mode, unitType); | 
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 416         s_lengthModeMap.set(SVGNames::startOffsetAttr, LengthModeWidth); | 416         s_lengthModeMap.set(SVGNames::startOffsetAttr, LengthModeWidth); | 
| 417     } | 417     } | 
| 418 | 418 | 
| 419     if (s_lengthModeMap.contains(attrName)) | 419     if (s_lengthModeMap.contains(attrName)) | 
| 420         return s_lengthModeMap.get(attrName); | 420         return s_lengthModeMap.get(attrName); | 
| 421 | 421 | 
| 422     return LengthModeOther; | 422     return LengthModeOther; | 
| 423 } | 423 } | 
| 424 | 424 | 
| 425 } | 425 } | 
| OLD | NEW | 
|---|