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/LayoutTableSection.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/LayoutTableSection.h ('k') | Source/core/layout/LayoutText.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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 // Our base size is the biggest logical height from our cells' style s (excluding row spanning cells). 727 // Our base size is the biggest logical height from our cells' style s (excluding row spanning cells).
728 m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_gri d[r].logicalHeight, 0).round(), 0); 728 m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_gri d[r].logicalHeight, 0).round(), 0);
729 } else { 729 } else {
730 // Non-specified lengths are ignored because the row already account s for the cells 730 // Non-specified lengths are ignored because the row already account s for the cells
731 // intrinsic logical height. 731 // intrinsic logical height.
732 m_rowPos[r + 1] = std::max(m_rowPos[r], 0); 732 m_rowPos[r + 1] = std::max(m_rowPos[r], 0);
733 } 733 }
734 734
735 Row& row = m_grid[r].row; 735 Row& row = m_grid[r].row;
736 unsigned totalCols = row.size(); 736 unsigned totalCols = row.size();
737 LayoutTableCell* lastRowSpanCell = 0; 737 LayoutTableCell* lastRowSpanCell = nullptr;
738 738
739 for (unsigned c = 0; c < totalCols; c++) { 739 for (unsigned c = 0; c < totalCols; c++) {
740 CellStruct& current = cellAt(r, c); 740 CellStruct& current = cellAt(r, c);
741 for (unsigned i = 0; i < current.cells.size(); i++) { 741 for (unsigned i = 0; i < current.cells.size(); i++) {
742 cell = current.cells[i]; 742 cell = current.cells[i];
743 if (current.inColSpan && cell->rowSpan() == 1) 743 if (current.inColSpan && cell->rowSpan() == 1)
744 continue; 744 continue;
745 745
746 if (cell->rowSpan() > 1) { 746 if (cell->rowSpan() > 1) {
747 // For row spanning cells, we only handle them for the first row they span. This ensures we take their baseline into account. 747 // For row spanning cells, we only handle them for the first row they span. This ensures we take their baseline into account.
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 { 1607 {
1608 ASSERT(table()->collapseBorders()); 1608 ASSERT(table()->collapseBorders());
1609 CellsCollapsedBordersMap::const_iterator it = m_cellsCollapsedBorders.find(s td::make_pair(cell, side)); 1609 CellsCollapsedBordersMap::const_iterator it = m_cellsCollapsedBorders.find(s td::make_pair(cell, side));
1610 ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end()); 1610 ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end());
1611 return it->value; 1611 return it->value;
1612 } 1612 }
1613 1613
1614 LayoutTableSection* LayoutTableSection::createAnonymousWithParent(const LayoutOb ject* parent) 1614 LayoutTableSection* LayoutTableSection::createAnonymousWithParent(const LayoutOb ject* parent)
1615 { 1615 {
1616 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE_ROW_GROUP); 1616 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), TABLE_ROW_GROUP);
1617 LayoutTableSection* newSection = new LayoutTableSection(0); 1617 LayoutTableSection* newSection = new LayoutTableSection(nullptr);
1618 newSection->setDocumentForAnonymous(&parent->document()); 1618 newSection->setDocumentForAnonymous(&parent->document());
1619 newSection->setStyle(newStyle.release()); 1619 newSection->setStyle(newStyle.release());
1620 return newSection; 1620 return newSection;
1621 } 1621 }
1622 1622
1623 void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign ed effectiveColumn) const 1623 void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign ed effectiveColumn) const
1624 { 1624 {
1625 LayoutPoint cellLocation(0, m_rowPos[cell->rowIndex()]); 1625 LayoutPoint cellLocation(0, m_rowPos[cell->rowIndex()]);
1626 int horizontalBorderSpacing = table()->hBorderSpacing(); 1626 int horizontalBorderSpacing = table()->hBorderSpacing();
1627 1627
1628 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1628 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1629 if (!style()->isLeftToRightDirection()) 1629 if (!style()->isLeftToRightDirection())
1630 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1630 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1631 else 1631 else
1632 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1632 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1633 1633
1634 cell->setLogicalLocation(cellLocation); 1634 cell->setLogicalLocation(cellLocation);
1635 } 1635 }
1636 1636
1637 } // namespace blink 1637 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/layout/LayoutText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698