OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 return false; | 289 return false; |
290 | 290 |
291 logicalAttributes = m_layoutAttributes[m_layoutAttributesPosition]; | 291 logicalAttributes = m_layoutAttributes[m_layoutAttributesPosition]; |
292 m_logicalMetricsListOffset = 0; | 292 m_logicalMetricsListOffset = 0; |
293 m_logicalCharacterOffset = 0; | 293 m_logicalCharacterOffset = 0; |
294 return true; | 294 return true; |
295 } | 295 } |
296 | 296 |
297 bool SVGTextLayoutEngine::currentLogicalCharacterMetrics(SVGTextLayoutAttributes
*& logicalAttributes, SVGTextMetrics& logicalMetrics) | 297 bool SVGTextLayoutEngine::currentLogicalCharacterMetrics(SVGTextLayoutAttributes
*& logicalAttributes, SVGTextMetrics& logicalMetrics) |
298 { | 298 { |
299 const Vector<SVGTextMetrics>* textMetricsValues = &logicalAttributes->textMe
tricsValues(); | 299 const Vector<SVGTextMetrics>* metricsList = &logicalAttributes->context()->m
etricsList(); |
300 unsigned textMetricsSize = textMetricsValues->size(); | 300 unsigned metricsListSize = metricsList->size(); |
301 while (true) { | 301 while (true) { |
302 if (m_logicalMetricsListOffset == textMetricsSize) { | 302 if (m_logicalMetricsListOffset == metricsListSize) { |
303 if (!currentLogicalCharacterAttributes(logicalAttributes)) | 303 if (!currentLogicalCharacterAttributes(logicalAttributes)) |
304 return false; | 304 return false; |
305 | 305 |
306 textMetricsValues = &logicalAttributes->textMetricsValues(); | 306 metricsList = &logicalAttributes->context()->metricsList(); |
307 textMetricsSize = textMetricsValues->size(); | 307 metricsListSize = metricsList->size(); |
308 continue; | 308 continue; |
309 } | 309 } |
310 | 310 |
311 ASSERT(textMetricsSize); | 311 ASSERT(metricsListSize); |
312 ASSERT(m_logicalMetricsListOffset < textMetricsSize); | 312 ASSERT(m_logicalMetricsListOffset < metricsListSize); |
313 logicalMetrics = textMetricsValues->at(m_logicalMetricsListOffset); | 313 logicalMetrics = metricsList->at(m_logicalMetricsListOffset); |
314 if (logicalMetrics.isEmpty() || (!logicalMetrics.width() && !logicalMetr
ics.height())) { | 314 if (logicalMetrics.isEmpty() || (!logicalMetrics.width() && !logicalMetr
ics.height())) { |
315 advanceToNextLogicalCharacter(logicalMetrics); | 315 advanceToNextLogicalCharacter(logicalMetrics); |
316 continue; | 316 continue; |
317 } | 317 } |
318 | 318 |
319 // Stop if we found the next valid logical text metrics object. | 319 // Stop if we found the next valid logical text metrics object. |
320 return true; | 320 return true; |
321 } | 321 } |
322 | 322 |
323 ASSERT_NOT_REACHED(); | 323 ASSERT_NOT_REACHED(); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 } | 533 } |
534 | 534 |
535 if (!didStartTextFragment) | 535 if (!didStartTextFragment) |
536 return; | 536 return; |
537 | 537 |
538 // Close last open fragment, if needed. | 538 // Close last open fragment, if needed. |
539 recordTextFragment(textBox); | 539 recordTextFragment(textBox); |
540 } | 540 } |
541 | 541 |
542 } // namespace blink | 542 } // namespace blink |
OLD | NEW |