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

Side by Side Diff: Source/core/layout/LayoutCounter.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/LayoutCounter.h ('k') | Source/core/layout/LayoutDeprecatedFlexibleBox.cpp » ('j') | 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) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 2 * Copyright (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (object.hasCounterNodeMap()) { 297 if (object.hasCounterNodeMap()) {
298 if (CounterMap* nodeMap = counterMaps().get(&object)) { 298 if (CounterMap* nodeMap = counterMaps().get(&object)) {
299 if (CounterNode* node = nodeMap->get(identifier)) 299 if (CounterNode* node = nodeMap->get(identifier))
300 return node; 300 return node;
301 } 301 }
302 } 302 }
303 303
304 bool isReset = false; 304 bool isReset = false;
305 int value = 0; 305 int value = 0;
306 if (!planCounter(object, identifier, isReset, value) && !alwaysCreateCounter ) 306 if (!planCounter(object, identifier, isReset, value) && !alwaysCreateCounter )
307 return 0; 307 return nullptr;
308 308
309 RefPtr<CounterNode> newParent = nullptr; 309 RefPtr<CounterNode> newParent = nullptr;
310 RefPtr<CounterNode> newPreviousSibling = nullptr; 310 RefPtr<CounterNode> newPreviousSibling = nullptr;
311 RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value); 311 RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value);
312 if (findPlaceForCounter(object, identifier, isReset, newParent, newPreviousS ibling)) 312 if (findPlaceForCounter(object, identifier, isReset, newParent, newPreviousS ibling))
313 newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifi er); 313 newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifi er);
314 CounterMap* nodeMap; 314 CounterMap* nodeMap;
315 if (object.hasCounterNodeMap()) { 315 if (object.hasCounterNodeMap()) {
316 nodeMap = counterMaps().get(&object); 316 nodeMap = counterMaps().get(&object);
317 } else { 317 } else {
(...skipping 22 matching lines...) Expand all
340 if (stayWithin == parentElement(*currentLayoutObject) && currentCounter- >hasResetType()) 340 if (stayWithin == parentElement(*currentLayoutObject) && currentCounter- >hasResetType())
341 break; 341 break;
342 newNode->insertAfter(currentCounter, newNode->lastChild(), identifier); 342 newNode->insertAfter(currentCounter, newNode->lastChild(), identifier);
343 } 343 }
344 return newNode.get(); 344 return newNode.get();
345 } 345 }
346 346
347 LayoutCounter::LayoutCounter(Document* node, const CounterContent& counter) 347 LayoutCounter::LayoutCounter(Document* node, const CounterContent& counter)
348 : LayoutText(node, StringImpl::empty()) 348 : LayoutText(node, StringImpl::empty())
349 , m_counter(counter) 349 , m_counter(counter)
350 , m_counterNode(0) 350 , m_counterNode(nullptr)
351 , m_nextForSameCounter(0) 351 , m_nextForSameCounter(nullptr)
352 { 352 {
353 view()->addLayoutCounter(); 353 view()->addLayoutCounter();
354 } 354 }
355 355
356 LayoutCounter::~LayoutCounter() 356 LayoutCounter::~LayoutCounter()
357 { 357 {
358 } 358 }
359 359
360 void LayoutCounter::willBeDestroyed() 360 void LayoutCounter::willBeDestroyed()
361 { 361 {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 fprintf(stderr, " "); 598 fprintf(stderr, " ");
599 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", 599 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n",
600 current, current->node(), current->parent(), current->previousSiblin g(), 600 current, current->node(), current->parent(), current->previousSiblin g(),
601 current->nextSibling(), current->hasCounterNodeMap() ? 601 current->nextSibling(), current->hasCounterNodeMap() ?
602 counterName ? blink::counterMaps().get(current)->get(identifier) : ( blink::CounterNode*)1 : (blink::CounterNode*)0); 602 counterName ? blink::counterMaps().get(current)->get(identifier) : ( blink::CounterNode*)1 : (blink::CounterNode*)0);
603 } 603 }
604 fflush(stderr); 604 fflush(stderr);
605 } 605 }
606 606
607 #endif // NDEBUG 607 #endif // NDEBUG
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutCounter.h ('k') | Source/core/layout/LayoutDeprecatedFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698