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

Unified Diff: Source/core/layout/line/InlineBox.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/layout/line/InlineFlowBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/InlineBox.cpp
diff --git a/Source/core/layout/line/InlineBox.cpp b/Source/core/layout/line/InlineBox.cpp
index a9818dec7045e83bff2c315a6fb208fe20e4a8e2..0581080560e5af6e5feebe9a9f2323a3ee51f74e 100644
--- a/Source/core/layout/line/InlineBox.cpp
+++ b/Source/core/layout/line/InlineBox.cpp
@@ -178,7 +178,7 @@ void InlineBox::dirtyLineBoxes()
void InlineBox::deleteLine()
{
if (!m_bitfields.extracted() && layoutObject().isBox())
- toLayoutBox(layoutObject()).setInlineBoxWrapper(0);
+ toLayoutBox(layoutObject()).setInlineBoxWrapper(nullptr);
destroy();
}
@@ -186,7 +186,7 @@ void InlineBox::extractLine()
{
m_bitfields.setExtracted(true);
if (layoutObject().isBox())
- toLayoutBox(layoutObject()).setInlineBoxWrapper(0);
+ toLayoutBox(layoutObject()).setInlineBoxWrapper(nullptr);
}
void InlineBox::attachLine()
@@ -264,7 +264,7 @@ bool InlineBox::nextOnLineExists() const
InlineBox* InlineBox::nextLeafChild() const
{
- InlineBox* leaf = 0;
+ InlineBox* leaf = nullptr;
for (InlineBox* box = nextOnLine(); box && !leaf; box = box->nextOnLine())
leaf = box->isLeaf() ? box : toInlineFlowBox(box)->firstLeafChild();
if (!leaf && parent())
@@ -274,7 +274,7 @@ InlineBox* InlineBox::nextLeafChild() const
InlineBox* InlineBox::prevLeafChild() const
{
- InlineBox* leaf = 0;
+ InlineBox* leaf = nullptr;
for (InlineBox* box = prevOnLine(); box && !leaf; box = box->prevOnLine())
leaf = box->isLeaf() ? box : toInlineFlowBox(box)->lastLeafChild();
if (!leaf && parent())
@@ -285,17 +285,13 @@ InlineBox* InlineBox::prevLeafChild() const
InlineBox* InlineBox::nextLeafChildIgnoringLineBreak() const
{
InlineBox* leaf = nextLeafChild();
- if (leaf && leaf->isLineBreak())
- return 0;
- return leaf;
+ return (leaf && leaf->isLineBreak()) ? nullptr : leaf;
}
InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const
{
InlineBox* leaf = prevLeafChild();
- if (leaf && leaf->isLineBreak())
- return 0;
- return leaf;
+ return (leaf && leaf->isLineBreak()) ? nullptr : leaf;
}
LayoutObject::SelectionState InlineBox::selectionState() const
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/layout/line/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698