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

Side by Side Diff: Source/core/layout/TableLayoutAlgorithmAuto.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/OrderIterator.cpp ('k') | Source/core/layout/TextAutosizer.h » ('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) 2002 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org)
3 * (C) 2002 Dirk Mueller (mueller@kde.org) 3 * (C) 2002 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License. 9 * version 2 of the License.
10 * 10 *
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 TableLayoutAlgorithmAuto::~TableLayoutAlgorithmAuto() 40 TableLayoutAlgorithmAuto::~TableLayoutAlgorithmAuto()
41 { 41 {
42 } 42 }
43 43
44 void TableLayoutAlgorithmAuto::recalcColumn(unsigned effCol) 44 void TableLayoutAlgorithmAuto::recalcColumn(unsigned effCol)
45 { 45 {
46 Layout& columnLayout = m_layoutStruct[effCol]; 46 Layout& columnLayout = m_layoutStruct[effCol];
47 47
48 LayoutTableCell* fixedContributor = 0; 48 LayoutTableCell* fixedContributor = nullptr;
49 LayoutTableCell* maxContributor = 0; 49 LayoutTableCell* maxContributor = nullptr;
50 50
51 for (LayoutObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) { 51 for (LayoutObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) {
52 if (child->isLayoutTableCol()) { 52 if (child->isLayoutTableCol()) {
53 // LayoutTableCols don't have the concept of preferred logical width , but we need to clear their dirty bits 53 // LayoutTableCols don't have the concept of preferred logical width , but we need to clear their dirty bits
54 // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's 54 // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's
55 // ancestors as dirty. 55 // ancestors as dirty.
56 toLayoutTableCol(child)->clearPreferredLogicalWidthsDirtyBits(); 56 toLayoutTableCol(child)->clearPreferredLogicalWidthsDirtyBits();
57 } else if (child->isTableSection()) { 57 } else if (child->isTableSection()) {
58 LayoutTableSection* section = toLayoutTableSection(child); 58 LayoutTableSection* section = toLayoutTableSection(child);
59 unsigned numRows = section->numRows(); 59 unsigned numRows = section->numRows();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 insertSpanCell(cell); 124 insertSpanCell(cell);
125 } 125 }
126 } 126 }
127 } 127 }
128 } 128 }
129 129
130 // Nav/IE weirdness 130 // Nav/IE weirdness
131 if (columnLayout.logicalWidth.isFixed()) { 131 if (columnLayout.logicalWidth.isFixed()) {
132 if (m_table->document().inQuirksMode() && columnLayout.maxLogicalWidth > columnLayout.logicalWidth.value() && fixedContributor != maxContributor) { 132 if (m_table->document().inQuirksMode() && columnLayout.maxLogicalWidth > columnLayout.logicalWidth.value() && fixedContributor != maxContributor) {
133 columnLayout.logicalWidth = Length(); 133 columnLayout.logicalWidth = Length();
134 fixedContributor = 0; 134 fixedContributor = nullptr;
135 } 135 }
136 } 136 }
137 137
138 columnLayout.maxLogicalWidth = std::max(columnLayout.maxLogicalWidth, column Layout.minLogicalWidth); 138 columnLayout.maxLogicalWidth = std::max(columnLayout.maxLogicalWidth, column Layout.minLogicalWidth);
139 } 139 }
140 140
141 void TableLayoutAlgorithmAuto::fullRecalc() 141 void TableLayoutAlgorithmAuto::fullRecalc()
142 { 142 {
143 m_hasPercent = false; 143 m_hasPercent = false;
144 m_effectiveLogicalWidthDirty = true; 144 m_effectiveLogicalWidthDirty = true;
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 int reduce = available * minMaxDiff / logicalWidthBeyondMin; 692 int reduce = available * minMaxDiff / logicalWidthBeyondMin;
693 m_layoutStruct[i].computedLogicalWidth += reduce; 693 m_layoutStruct[i].computedLogicalWidth += reduce;
694 available -= reduce; 694 available -= reduce;
695 logicalWidthBeyondMin -= minMaxDiff; 695 logicalWidthBeyondMin -= minMaxDiff;
696 if (available >= 0) 696 if (available >= 0)
697 break; 697 break;
698 } 698 }
699 } 699 }
700 } 700 }
701 } 701 }
OLDNEW
« no previous file with comments | « Source/core/layout/OrderIterator.cpp ('k') | Source/core/layout/TextAutosizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698