summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocumentfragment.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-22 14:46:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-06 12:13:20 +0100
commitece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch)
treefa4a0fdbda040d24f1a2d07a320635c76980f431 /src/gui/text/qtextdocumentfragment.cpp
parentb19220d17fa66de5ded41690ffff263ee2af5c63 (diff)
Tidy nullptr usage
Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text/qtextdocumentfragment.cpp')
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index 742c56382d..d7bc707491 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -277,7 +277,7 @@ void QTextDocumentFragmentPrivate::insert(QTextCursor &_cursor) const
\sa isEmpty()
*/
QTextDocumentFragment::QTextDocumentFragment()
- : d(0)
+ : d(nullptr)
{
}
@@ -287,7 +287,7 @@ QTextDocumentFragment::QTextDocumentFragment()
like the document's title.
*/
QTextDocumentFragment::QTextDocumentFragment(const QTextDocument *document)
- : d(0)
+ : d(nullptr)
{
if (!document)
return;
@@ -304,7 +304,7 @@ QTextDocumentFragment::QTextDocumentFragment(const QTextDocument *document)
\sa isEmpty(), QTextCursor::selection()
*/
QTextDocumentFragment::QTextDocumentFragment(const QTextCursor &cursor)
- : d(0)
+ : d(nullptr)
{
if (!cursor.hasSelection())
return;
@@ -678,7 +678,7 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processSpecialNodes()
if (n->parent)
n = &at(n->parent);
else
- n = 0;
+ n = nullptr;
}
}
@@ -793,7 +793,7 @@ bool QTextHtmlImporter::closeTag()
bool blockTagClosed = false;
while (depth > endDepth) {
- Table *t = 0;
+ Table *t = nullptr;
if (!tables.isEmpty())
t = &tables.last();
@@ -816,7 +816,7 @@ bool QTextHtmlImporter::closeTag()
indent = t->lastIndent;
tables.resize(tables.size() - 1);
- t = 0;
+ t = nullptr;
if (tables.isEmpty()) {
cursor = doc->rootFrame()->lastCursorPosition();
@@ -1123,7 +1123,7 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode()
// for list items we may want to collapse with the bottom margin of the
// list.
- const QTextHtmlParserNode *parentNode = currentNode->parent ? &at(currentNode->parent) : 0;
+ const QTextHtmlParserNode *parentNode = currentNode->parent ? &at(currentNode->parent) : nullptr;
if ((currentNode->id == Html_li || currentNode->id == Html_dt || currentNode->id == Html_dd)
&& parentNode
&& (parentNode->isListStart() || parentNode->id == Html_dl)
@@ -1270,7 +1270,7 @@ void QTextHtmlImporter::appendBlock(const QTextBlockFormat &format, QTextCharFor
QTextDocumentFragment QTextDocumentFragment::fromHtml(const QString &html)
{
- return fromHtml(html, 0);
+ return fromHtml(html, nullptr);
}
/*!