Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: Source/core/svg/properties/SVGPathSegListPropertyTearOff.cpp

Issue 19914002: Use toSVGPathElement() instead of static_cast<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (removedItem) 83 if (removedItem)
84 static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRol e(0, PathSegUndefinedRole); 84 static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRol e(0, PathSegUndefinedRole);
85 return removedItem.release(); 85 return removedItem.release();
86 } 86 }
87 87
88 SVGPathElement* SVGPathSegListPropertyTearOff::contextElement() const 88 SVGPathElement* SVGPathSegListPropertyTearOff::contextElement() const
89 { 89 {
90 SVGElement* contextElement = m_animatedProperty->contextElement(); 90 SVGElement* contextElement = m_animatedProperty->contextElement();
91 ASSERT(contextElement); 91 ASSERT(contextElement);
92 ASSERT(contextElement->hasTagName(SVGNames::pathTag)); 92 ASSERT(contextElement->hasTagName(SVGNames::pathTag));
93 return static_cast<SVGPathElement*>(contextElement); 93 return toSVGPathElement(contextElement);
94 } 94 }
95 95
96 bool SVGPathSegListPropertyTearOff::processIncomingListItemValue(const ListItemT ype& newItem, unsigned* indexToModify) 96 bool SVGPathSegListPropertyTearOff::processIncomingListItemValue(const ListItemT ype& newItem, unsigned* indexToModify)
97 { 97 {
98 SVGPathSegWithContext* newItemWithContext = static_cast<SVGPathSegWithContex t*>(newItem.get()); 98 SVGPathSegWithContext* newItemWithContext = static_cast<SVGPathSegWithContex t*>(newItem.get());
99 SVGAnimatedProperty* animatedPropertyOfItem = newItemWithContext->animatedPr operty(); 99 SVGAnimatedProperty* animatedPropertyOfItem = newItemWithContext->animatedPr operty();
100 100
101 // Alter the role, after calling animatedProperty(), as that may influence t he returned animated property. 101 // Alter the role, after calling animatedProperty(), as that may influence t he returned animated property.
102 newItemWithContext->setContextAndRole(contextElement(), m_pathSegRole); 102 newItemWithContext->setContextAndRole(contextElement(), m_pathSegRole);
103 103
(...skipping 26 matching lines...) Expand all
130 unsigned& index = *indexToModify; 130 unsigned& index = *indexToModify;
131 // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item. 131 // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item.
132 if (static_cast<unsigned>(indexToRemove) < index) 132 if (static_cast<unsigned>(indexToRemove) < index)
133 --index; 133 --index;
134 } 134 }
135 135
136 return true; 136 return true;
137 } 137 }
138 138
139 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698