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

Side by Side Diff: Source/core/layout/svg/SVGTextLayoutEngine.cpp

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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-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 27 matching lines...) Expand all
38 , m_layoutAttributesPosition(0) 38 , m_layoutAttributesPosition(0)
39 , m_logicalCharacterOffset(0) 39 , m_logicalCharacterOffset(0)
40 , m_logicalMetricsListOffset(0) 40 , m_logicalMetricsListOffset(0)
41 , m_x(0) 41 , m_x(0)
42 , m_y(0) 42 , m_y(0)
43 , m_dx(0) 43 , m_dx(0)
44 , m_dy(0) 44 , m_dy(0)
45 , m_isVerticalText(false) 45 , m_isVerticalText(false)
46 , m_inPathLayout(false) 46 , m_inPathLayout(false)
47 , m_textLengthSpacingInEffect(false) 47 , m_textLengthSpacingInEffect(false)
48 , m_textPathCalculator(0) 48 , m_textPathCalculator(nullptr)
49 , m_textPathLength(0) 49 , m_textPathLength(0)
50 , m_textPathCurrentOffset(0) 50 , m_textPathCurrentOffset(0)
51 , m_textPathSpacing(0) 51 , m_textPathSpacing(0)
52 , m_textPathScaling(1) 52 , m_textPathScaling(1)
53 { 53 {
54 ASSERT(!m_layoutAttributes.isEmpty()); 54 ASSERT(!m_layoutAttributes.isEmpty());
55 } 55 }
56 56
57 void SVGTextLayoutEngine::updateCharacterPositionIfNeeded(float& x, float& y) 57 void SVGTextLayoutEngine::updateCharacterPositionIfNeeded(float& x, float& y)
58 { 58 {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 // Main layout algorithm. 354 // Main layout algorithm.
355 const unsigned boxEndOffset = textBox->start() + textBox->len(); 355 const unsigned boxEndOffset = textBox->start() + textBox->len();
356 while (!m_visualMetricsIterator.isAtEnd() && m_visualMetricsIterator.charact erOffset() < boxEndOffset) { 356 while (!m_visualMetricsIterator.isAtEnd() && m_visualMetricsIterator.charact erOffset() < boxEndOffset) {
357 const SVGTextMetrics& visualMetrics = m_visualMetricsIterator.metrics(); 357 const SVGTextMetrics& visualMetrics = m_visualMetricsIterator.metrics();
358 if (visualMetrics.isEmpty()) { 358 if (visualMetrics.isEmpty()) {
359 m_visualMetricsIterator.next(); 359 m_visualMetricsIterator.next();
360 continue; 360 continue;
361 } 361 }
362 362
363 SVGTextLayoutAttributes* logicalAttributes = 0; 363 SVGTextLayoutAttributes* logicalAttributes = nullptr;
364 if (!currentLogicalCharacterAttributes(logicalAttributes)) 364 if (!currentLogicalCharacterAttributes(logicalAttributes))
365 break; 365 break;
366 366
367 ASSERT(logicalAttributes); 367 ASSERT(logicalAttributes);
368 SVGTextMetrics logicalMetrics(SVGTextMetrics::SkippedSpaceMetrics); 368 SVGTextMetrics logicalMetrics(SVGTextMetrics::SkippedSpaceMetrics);
369 if (!currentLogicalCharacterMetrics(logicalAttributes, logicalMetrics)) 369 if (!currentLogicalCharacterMetrics(logicalAttributes, logicalMetrics))
370 break; 370 break;
371 371
372 SVGCharacterDataMap& characterDataMap = logicalAttributes->characterData Map(); 372 SVGCharacterDataMap& characterDataMap = logicalAttributes->characterData Map();
373 SVGCharacterData data; 373 SVGCharacterData data;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 } 532 }
533 533
534 if (!didStartTextFragment) 534 if (!didStartTextFragment)
535 return; 535 return;
536 536
537 // Close last open fragment, if needed. 537 // Close last open fragment, if needed.
538 recordTextFragment(textBox); 538 recordTextFragment(textBox);
539 } 539 }
540 540
541 } 541 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/SVGTextLayoutAttributesBuilder.h ('k') | Source/core/layout/svg/SVGTextMetrics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698