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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 m_value = FloatRect(x, y, width, height); | 66 m_value = FloatRect(x, y, width, height); |
67 m_isValid = true; | 67 m_isValid = true; |
68 return true; | 68 return true; |
69 } | 69 } |
70 | 70 |
71 SVGParsingError SVGRect::setValueAsString(const String& string) | 71 SVGParsingError SVGRect::setValueAsString(const String& string) |
72 { | 72 { |
73 setInvalid(); | 73 setInvalid(); |
74 | 74 |
75 if (string.isNull()) | 75 if (string.isNull()) |
76 return NoError; | 76 return SVGParseStatus::NoError; |
77 | 77 |
78 if (string.isEmpty()) { | 78 if (string.isEmpty()) { |
79 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); | 79 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); |
80 m_isValid = true; | 80 m_isValid = true; |
81 return NoError; | 81 return SVGParseStatus::NoError; |
82 } | 82 } |
83 | 83 |
84 bool valid; | 84 bool valid; |
85 if (string.is8Bit()) { | 85 if (string.is8Bit()) { |
86 const LChar* ptr = string.characters8(); | 86 const LChar* ptr = string.characters8(); |
87 const LChar* end = ptr + string.length(); | 87 const LChar* end = ptr + string.length(); |
88 valid = parse(ptr, end); | 88 valid = parse(ptr, end); |
89 } else { | 89 } else { |
90 const UChar* ptr = string.characters16(); | 90 const UChar* ptr = string.characters16(); |
91 const UChar* end = ptr + string.length(); | 91 const UChar* end = ptr + string.length(); |
92 valid = parse(ptr, end); | 92 valid = parse(ptr, end); |
93 } | 93 } |
94 return valid ? NoError : ParsingAttributeFailedError; | 94 return valid ? SVGParseStatus::NoError : SVGParseStatus::ParsingFailed; |
95 } | 95 } |
96 | 96 |
97 String SVGRect::valueAsString() const | 97 String SVGRect::valueAsString() const |
98 { | 98 { |
99 StringBuilder builder; | 99 StringBuilder builder; |
100 builder.appendNumber(x()); | 100 builder.appendNumber(x()); |
101 builder.append(' '); | 101 builder.append(' '); |
102 builder.appendNumber(y()); | 102 builder.appendNumber(y()); |
103 builder.append(' '); | 103 builder.append(' '); |
104 builder.appendNumber(width()); | 104 builder.appendNumber(width()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return -1; | 137 return -1; |
138 } | 138 } |
139 | 139 |
140 void SVGRect::setInvalid() | 140 void SVGRect::setInvalid() |
141 { | 141 { |
142 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); | 142 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); |
143 m_isValid = false; | 143 m_isValid = false; |
144 } | 144 } |
145 | 145 |
146 } | 146 } |
OLD | NEW |