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

Side by Side Diff: Source/core/layout/svg/line/SVGRootInlineBox.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
« no previous file with comments | « Source/core/layout/svg/line/SVGRootInlineBox.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * Copyright (C) 2011 Torch Mobile (Beijing) CO. Ltd. All rights reserved. 6 * Copyright (C) 2011 Torch Mobile (Beijing) CO. Ltd. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 InlineBox* SVGRootInlineBox::closestLeafChildForPosition(const LayoutPoint& poin t) 132 InlineBox* SVGRootInlineBox::closestLeafChildForPosition(const LayoutPoint& poin t)
133 { 133 {
134 InlineBox* firstLeaf = firstLeafChild(); 134 InlineBox* firstLeaf = firstLeafChild();
135 InlineBox* lastLeaf = lastLeafChild(); 135 InlineBox* lastLeaf = lastLeafChild();
136 if (firstLeaf == lastLeaf) 136 if (firstLeaf == lastLeaf)
137 return firstLeaf; 137 return firstLeaf;
138 138
139 // FIXME: Check for vertical text! 139 // FIXME: Check for vertical text!
140 InlineBox* closestLeaf = 0; 140 InlineBox* closestLeaf = nullptr;
141 for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChild()) { 141 for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChild()) {
142 if (!leaf->isSVGInlineTextBox()) 142 if (!leaf->isSVGInlineTextBox())
143 continue; 143 continue;
144 if (point.y() < leaf->y()) 144 if (point.y() < leaf->y())
145 continue; 145 continue;
146 if (point.y() > leaf->y() + leaf->virtualLogicalHeight()) 146 if (point.y() > leaf->y() + leaf->virtualLogicalHeight())
147 continue; 147 continue;
148 148
149 closestLeaf = leaf; 149 closestLeaf = leaf;
150 if (point.x() < leaf->left() + leaf->logicalWidth()) 150 if (point.x() < leaf->left() + leaf->logicalWidth())
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 207
208 SVGInlineTextBox* firstTextBox = toSVGInlineTextBox(*first); 208 SVGInlineTextBox* firstTextBox = toSVGInlineTextBox(*first);
209 SVGInlineTextBox* lastTextBox = toSVGInlineTextBox(*last); 209 SVGInlineTextBox* lastTextBox = toSVGInlineTextBox(*last);
210 210
211 // Reordering is only necessary for BiDi text that is _absolutely_ posit ioned. 211 // Reordering is only necessary for BiDi text that is _absolutely_ posit ioned.
212 if (firstTextBox->len() == 1 && firstTextBox->len() == lastTextBox->len( )) { 212 if (firstTextBox->len() == 1 && firstTextBox->len() == lastTextBox->len( )) {
213 LayoutSVGInlineText& firstContext = toLayoutSVGInlineText(firstTextB ox->layoutObject()); 213 LayoutSVGInlineText& firstContext = toLayoutSVGInlineText(firstTextB ox->layoutObject());
214 LayoutSVGInlineText& lastContext = toLayoutSVGInlineText(lastTextBox ->layoutObject()); 214 LayoutSVGInlineText& lastContext = toLayoutSVGInlineText(lastTextBox ->layoutObject());
215 215
216 SVGTextLayoutAttributes* firstAttributes = 0; 216 SVGTextLayoutAttributes* firstAttributes = nullptr;
217 SVGTextLayoutAttributes* lastAttributes = 0; 217 SVGTextLayoutAttributes* lastAttributes = nullptr;
218 findFirstAndLastAttributesInVector(attributes, &firstContext, &lastC ontext, firstAttributes, lastAttributes); 218 findFirstAndLastAttributesInVector(attributes, &firstContext, &lastC ontext, firstAttributes, lastAttributes);
219 swapItemsInLayoutAttributes(firstAttributes, lastAttributes, firstTe xtBox->start(), lastTextBox->start()); 219 swapItemsInLayoutAttributes(firstAttributes, lastAttributes, firstTe xtBox->start(), lastTextBox->start());
220 } 220 }
221 221
222 InlineBox* temp = *first; 222 InlineBox* temp = *first;
223 *first = *last; 223 *first = *last;
224 *last = temp; 224 *last = temp;
225 225
226 ++first; 226 ++first;
227 } 227 }
228 } 228 }
229 229
230 void SVGRootInlineBox::reorderValueLists(Vector<SVGTextLayoutAttributes*>& attri butes) 230 void SVGRootInlineBox::reorderValueLists(Vector<SVGTextLayoutAttributes*>& attri butes)
231 { 231 {
232 Vector<InlineBox*> leafBoxesInLogicalOrder; 232 Vector<InlineBox*> leafBoxesInLogicalOrder;
233 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder, reverseInlineBoxRang eAndValueListsIfNeeded, &attributes); 233 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder, reverseInlineBoxRang eAndValueListsIfNeeded, &attributes);
234 } 234 }
235 235
236 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/svg/line/SVGRootInlineBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698