| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2011. 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 void SVGTextLayoutAttributesBuilder::buildCharacterDataMap( | 145 void SVGTextLayoutAttributesBuilder::buildCharacterDataMap( |
| 146 LayoutSVGText& textRoot) { | 146 LayoutSVGText& textRoot) { |
| 147 // Fill character data map using text positioning elements in top-down order. | 147 // Fill character data map using text positioning elements in top-down order. |
| 148 for (const TextPosition& position : m_textPositions) | 148 for (const TextPosition& position : m_textPositions) |
| 149 fillCharacterDataMap(position); | 149 fillCharacterDataMap(position); |
| 150 | 150 |
| 151 // Handle x/y default attributes. | 151 // Handle x/y default attributes. |
| 152 SVGCharacterData& data = | 152 SVGCharacterData& data = |
| 153 m_characterDataMap.add(1, SVGCharacterData()).storedValue->value; | 153 m_characterDataMap.insert(1, SVGCharacterData()).storedValue->value; |
| 154 if (!data.hasX()) | 154 if (!data.hasX()) |
| 155 data.x = 0; | 155 data.x = 0; |
| 156 if (!data.hasY()) | 156 if (!data.hasY()) |
| 157 data.y = 0; | 157 data.y = 0; |
| 158 } | 158 } |
| 159 | 159 |
| 160 namespace { | 160 namespace { |
| 161 | 161 |
| 162 class AttributeListsIterator { | 162 class AttributeListsIterator { |
| 163 STACK_ALLOCATED(); | 163 STACK_ALLOCATED(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace | 230 } // namespace |
| 231 | 231 |
| 232 void SVGTextLayoutAttributesBuilder::fillCharacterDataMap( | 232 void SVGTextLayoutAttributesBuilder::fillCharacterDataMap( |
| 233 const TextPosition& position) { | 233 const TextPosition& position) { |
| 234 AttributeListsIterator attrLists(position.element); | 234 AttributeListsIterator attrLists(position.element); |
| 235 for (unsigned i = 0; attrLists.hasAttributes() && i < position.length; ++i) { | 235 for (unsigned i = 0; attrLists.hasAttributes() && i < position.length; ++i) { |
| 236 SVGCharacterData& data = | 236 SVGCharacterData& data = |
| 237 m_characterDataMap.add(position.start + i + 1, SVGCharacterData()) | 237 m_characterDataMap.insert(position.start + i + 1, SVGCharacterData()) |
| 238 .storedValue->value; | 238 .storedValue->value; |
| 239 attrLists.updateCharacterData(i, data); | 239 attrLists.updateCharacterData(i, data); |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 | 242 |
| 243 DEFINE_TRACE(SVGTextLayoutAttributesBuilder::TextPosition) { | 243 DEFINE_TRACE(SVGTextLayoutAttributesBuilder::TextPosition) { |
| 244 visitor->trace(element); | 244 visitor->trace(element); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace blink | 247 } // namespace blink |
| OLD | NEW |