OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // ',' requires the list to be continued | 81 // ',' requires the list to be continued |
82 continue; | 82 continue; |
83 } | 83 } |
84 | 84 |
85 // check end of list | 85 // check end of list |
86 if (ptr >= end) | 86 if (ptr >= end) |
87 return true; | 87 return true; |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 void SVGPointList::setValueAsString(const String& value, ExceptionState& excepti
onState) | 91 SVGParsingError SVGPointList::setValueAsString(const String& value) |
92 { | 92 { |
93 if (value.isEmpty()) { | 93 if (value.isEmpty()) { |
94 clear(); | 94 clear(); |
95 return; | 95 return NoError; |
96 } | 96 } |
97 | 97 |
98 bool valid = false; | 98 bool valid = false; |
99 if (value.is8Bit()) { | 99 if (value.is8Bit()) { |
100 const LChar* ptr = value.characters8(); | 100 const LChar* ptr = value.characters8(); |
101 const LChar* end = ptr + value.length(); | 101 const LChar* end = ptr + value.length(); |
102 valid = parse(ptr, end); | 102 valid = parse(ptr, end); |
103 } else { | 103 } else { |
104 const UChar* ptr = value.characters16(); | 104 const UChar* ptr = value.characters16(); |
105 const UChar* end = ptr + value.length(); | 105 const UChar* end = ptr + value.length(); |
106 valid = parse(ptr, end); | 106 valid = parse(ptr, end); |
107 } | 107 } |
108 | 108 return valid ? NoError : ParsingAttributeFailedError; |
109 if (!valid) | |
110 exceptionState.throwDOMException(SyntaxError, "Problem parsing points=\"
"+value+"\""); | |
111 } | 109 } |
112 | 110 |
113 void SVGPointList::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement
* contextElement) | 111 void SVGPointList::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement
* contextElement) |
114 { | 112 { |
115 RefPtrWillBeRawPtr<SVGPointList> otherList = toSVGPointList(other); | 113 RefPtrWillBeRawPtr<SVGPointList> otherList = toSVGPointList(other); |
116 | 114 |
117 if (length() != otherList->length()) | 115 if (length() != otherList->length()) |
118 return; | 116 return; |
119 | 117 |
120 for (size_t i = 0; i < length(); ++i) | 118 for (size_t i = 0; i < length(); ++i) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 150 } |
153 } | 151 } |
154 | 152 |
155 float SVGPointList::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to
, SVGElement*) | 153 float SVGPointList::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to
, SVGElement*) |
156 { | 154 { |
157 // FIXME: Distance calculation is not possible for SVGPointList right now. W
e need the distance for every single value. | 155 // FIXME: Distance calculation is not possible for SVGPointList right now. W
e need the distance for every single value. |
158 return -1; | 156 return -1; |
159 } | 157 } |
160 | 158 |
161 } | 159 } |
OLD | NEW |