| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 static PassRefPtr<Self> create(const PropertyType& initialValue) | 49 static PassRefPtr<Self> create(const PropertyType& initialValue) |
| 50 { | 50 { |
| 51 return adoptRef(new Self(initialValue)); | 51 return adoptRef(new Self(initialValue)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 PropertyType& propertyReference() { return *m_value; } | 54 PropertyType& propertyReference() { return *m_value; } |
| 55 SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty; } | 55 SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty; } |
| 56 | 56 |
| 57 void setValue(PropertyType& value) | 57 void setValue(PropertyType& value) |
| 58 { | 58 { |
| 59 if (m_valueIsCopy) | 59 if (m_valueIsCopy) { |
| 60 detachChildren(); |
| 60 delete m_value; | 61 delete m_value; |
| 62 } |
| 61 m_valueIsCopy = false; | 63 m_valueIsCopy = false; |
| 62 m_value = &value; | 64 m_value = &value; |
| 63 } | 65 } |
| 64 | 66 |
| 65 void setAnimatedProperty(SVGAnimatedProperty* animatedProperty) | 67 void setAnimatedProperty(SVGAnimatedProperty* animatedProperty) |
| 66 { | 68 { |
| 67 m_animatedProperty = animatedProperty; | 69 m_animatedProperty = animatedProperty; |
| 68 | 70 |
| 69 if (m_animatedProperty) | 71 if (m_animatedProperty) |
| 70 m_contextElement = m_animatedProperty->contextElement(); | 72 m_contextElement = m_animatedProperty->contextElement(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 SVGAnimatedProperty* m_animatedProperty; | 160 SVGAnimatedProperty* m_animatedProperty; |
| 159 SVGPropertyRole m_role; | 161 SVGPropertyRole m_role; |
| 160 PropertyType* m_value; | 162 PropertyType* m_value; |
| 161 Vector<WeakPtr<SVGPropertyTearOffBase> > m_childTearOffs; | 163 Vector<WeakPtr<SVGPropertyTearOffBase> > m_childTearOffs; |
| 162 bool m_valueIsCopy : 1; | 164 bool m_valueIsCopy : 1; |
| 163 }; | 165 }; |
| 164 | 166 |
| 165 } | 167 } |
| 166 | 168 |
| 167 #endif // SVGPropertyTearOff_h | 169 #endif // SVGPropertyTearOff_h |
| OLD | NEW |