summaryrefslogtreecommitdiffstats
path: root/src/xml/dom/qdom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/dom/qdom.cpp')
-rw-r--r--src/xml/dom/qdom.cpp222
1 files changed, 111 insertions, 111 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 6498d53b96..8d232237bf 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -136,7 +136,7 @@ public:
class QDomNodePrivate
{
public:
- QDomNodePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0);
+ QDomNodePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = nullptr);
QDomNodePrivate(QDomNodePrivate* n, bool deep);
virtual ~QDomNodePrivate();
@@ -159,11 +159,11 @@ public:
virtual void normalize();
virtual void clear();
- inline QDomNodePrivate* parent() const { return hasParent ? ownerNode : 0; }
+ inline QDomNodePrivate* parent() const { return hasParent ? ownerNode : nullptr; }
inline void setParent(QDomNodePrivate *p) { ownerNode = p; hasParent = true; }
void setNoParent() {
- ownerNode = hasParent ? (QDomNodePrivate*)ownerDocument() : 0;
+ ownerNode = hasParent ? (QDomNodePrivate*)ownerDocument() : nullptr;
hasParent = false;
}
@@ -289,7 +289,7 @@ public:
class QDomDocumentTypePrivate : public QDomNodePrivate
{
public:
- QDomDocumentTypePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0);
+ QDomDocumentTypePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = nullptr);
QDomDocumentTypePrivate(QDomDocumentTypePrivate* n, bool deep);
~QDomDocumentTypePrivate();
void init();
@@ -317,7 +317,7 @@ public:
class QDomDocumentFragmentPrivate : public QDomNodePrivate
{
public:
- QDomDocumentFragmentPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0);
+ QDomDocumentFragmentPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = nullptr);
QDomDocumentFragmentPrivate(QDomNodePrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
@@ -907,7 +907,7 @@ QDomImplementationPrivate* QDomImplementationPrivate::clone()
*/
QDomImplementation::QDomImplementation()
{
- impl = 0;
+ impl = nullptr;
}
/*!
@@ -1036,7 +1036,7 @@ QDomDocumentType QDomImplementation::createDocumentType(const QString& qName, co
if (!ok)
return QDomDocumentType();
- QDomDocumentTypePrivate *dt = new QDomDocumentTypePrivate(0);
+ QDomDocumentTypePrivate *dt = new QDomDocumentTypePrivate(nullptr);
dt->name = fixedName;
if (systemId.isNull()) {
dt->publicId.clear();
@@ -1070,7 +1070,7 @@ QDomDocument QDomImplementation::createDocument(const QString& nsURI, const QStr
*/
bool QDomImplementation::isNull()
{
- return (impl == 0);
+ return (impl == nullptr);
}
/*!
@@ -1244,14 +1244,14 @@ void QDomNodeListPrivate::createList()
QDomNodePrivate* QDomNodeListPrivate::item(int index)
{
if (!node_impl)
- return 0;
+ return nullptr;
const QDomDocumentPrivate *const doc = node_impl->ownerDocument();
if (!doc || timestamp != doc->nodeListTime)
createList();
if (index >= list.size())
- return 0;
+ return nullptr;
return list.at(index);
}
@@ -1305,13 +1305,13 @@ int QDomNodeListPrivate::length() const
Creates an empty node list.
*/
QDomNodeList::QDomNodeList()
+ : impl(nullptr)
{
- impl = 0;
}
QDomNodeList::QDomNodeList(QDomNodeListPrivate* p)
+ : impl(p)
{
- impl = p;
}
/*!
@@ -1443,10 +1443,10 @@ QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par)
setParent(par);
else
setOwnerDocument(doc);
- prev = 0;
- next = 0;
- first = 0;
- last = 0;
+ prev = nullptr;
+ next = nullptr;
+ first = nullptr;
+ last = nullptr;
createdWithDom1Interface = true;
lineNumber = -1;
columnNumber = -1;
@@ -1455,10 +1455,10 @@ QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par)
QDomNodePrivate::QDomNodePrivate(QDomNodePrivate *n, bool deep) : ref(1)
{
setOwnerDocument(n->ownerDocument());
- prev = 0;
- next = 0;
- first = 0;
- last = 0;
+ prev = nullptr;
+ next = nullptr;
+ first = nullptr;
+ last = nullptr;
name = n->name;
value = n->value;
@@ -1488,8 +1488,8 @@ QDomNodePrivate::~QDomNodePrivate()
p->setNoParent();
p = n;
}
- first = 0;
- last = 0;
+ first = nullptr;
+ last = nullptr;
}
void QDomNodePrivate::clear()
@@ -1503,8 +1503,8 @@ void QDomNodePrivate::clear()
delete p;
p = n;
}
- first = 0;
- last = 0;
+ first = nullptr;
+ last = nullptr;
}
QDomNodePrivate* QDomNodePrivate::namedItem(const QString &n)
@@ -1515,7 +1515,7 @@ QDomNodePrivate* QDomNodePrivate::namedItem(const QString &n)
return p;
p = p->next;
}
- return 0;
+ return nullptr;
}
@@ -1523,15 +1523,15 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
{
// Error check
if (!newChild)
- return 0;
+ return nullptr;
// Error check
if (newChild == refChild)
- return 0;
+ return nullptr;
// Error check
if (refChild && refChild->parent() != this)
- return 0;
+ return nullptr;
// "mark lists as dirty"
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1542,7 +1542,7 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
// all elements of the fragment instead of the fragment itself.
if (newChild->isDocumentFragment()) {
// Fragment is empty ?
- if (newChild->first == 0)
+ if (newChild->first == nullptr)
return newChild;
// New parent
@@ -1553,7 +1553,7 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
}
// Insert at the beginning ?
- if (!refChild || refChild->prev == 0) {
+ if (!refChild || refChild->prev == nullptr) {
if (first)
first->prev = newChild->last;
newChild->last->next = first;
@@ -1572,8 +1572,8 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
// does not decrease the reference.
// Remove the nodes from the fragment
- newChild->first = 0;
- newChild->last = 0;
+ newChild->first = nullptr;
+ newChild->last = nullptr;
return newChild;
}
@@ -1596,7 +1596,7 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
return newChild;
}
- if (refChild->prev == 0) {
+ if (refChild->prev == nullptr) {
if (first)
first->prev = newChild;
newChild->next = first;
@@ -1618,15 +1618,15 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
{
// Error check
if (!newChild)
- return 0;
+ return nullptr;
// Error check
if (newChild == refChild)
- return 0;
+ return nullptr;
// Error check
if (refChild && refChild->parent() != this)
- return 0;
+ return nullptr;
// "mark lists as dirty"
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1637,7 +1637,7 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
// all elements of the fragment instead of the fragment itself.
if (newChild->isDocumentFragment()) {
// Fragment is empty ?
- if (newChild->first == 0)
+ if (newChild->first == nullptr)
return newChild;
// New parent
@@ -1648,7 +1648,7 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
}
// Insert at the end
- if (!refChild || refChild->next == 0) {
+ if (!refChild || refChild->next == nullptr) {
if (last)
last->next = newChild->first;
newChild->first->prev = last;
@@ -1666,8 +1666,8 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
// does not decrease the reference.
// Remove the nodes from the fragment
- newChild->first = 0;
- newChild->last = 0;
+ newChild->first = nullptr;
+ newChild->last = nullptr;
return newChild;
}
@@ -1692,7 +1692,7 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
return newChild;
}
- if (refChild->next == 0) {
+ if (refChild->next == nullptr) {
if (last)
last->next = newChild;
newChild->prev = last;
@@ -1713,11 +1713,11 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild)
{
if (!newChild || !oldChild)
- return 0;
+ return nullptr;
if (oldChild->parent() != this)
- return 0;
+ return nullptr;
if (newChild == oldChild)
- return 0;
+ return nullptr;
// mark lists as dirty
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1728,7 +1728,7 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
// all elements of the fragment instead of the fragment itself.
if (newChild->isDocumentFragment()) {
// Fragment is empty ?
- if (newChild->first == 0)
+ if (newChild->first == nullptr)
return newChild;
// New parent
@@ -1753,15 +1753,15 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
last = newChild->last;
oldChild->setNoParent();
- oldChild->next = 0;
- oldChild->prev = 0;
+ oldChild->next = nullptr;
+ oldChild->prev = nullptr;
// No need to increase the reference since QDomDocumentFragment
// does not decrease the reference.
// Remove the nodes from the fragment
- newChild->first = 0;
- newChild->last = 0;
+ newChild->first = nullptr;
+ newChild->last = nullptr;
// We are no longer interested in the old node
if (oldChild)
@@ -1794,8 +1794,8 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
last = newChild;
oldChild->setNoParent();
- oldChild->next = 0;
- oldChild->prev = 0;
+ oldChild->next = nullptr;
+ oldChild->prev = nullptr;
// We are no longer interested in the old node
if (oldChild)
@@ -1808,7 +1808,7 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
{
// Error check
if (oldChild->parent() != this)
- return 0;
+ return nullptr;
// "mark lists as dirty"
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1817,8 +1817,8 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
// Perhaps oldChild was just created with "createElement" or that. In this case
// its parent is QDomDocument but it is not part of the documents child list.
- if (oldChild->next == 0 && oldChild->prev == 0 && first != oldChild)
- return 0;
+ if (oldChild->next == nullptr && oldChild->prev == nullptr && first != oldChild)
+ return nullptr;
if (oldChild->next)
oldChild->next->prev = oldChild->prev;
@@ -1831,8 +1831,8 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
first = oldChild->next;
oldChild->setNoParent();
- oldChild->next = 0;
- oldChild->prev = 0;
+ oldChild->next = nullptr;
+ oldChild->prev = nullptr;
// We are no longer interested in the old node
oldChild->ref.deref();
@@ -1843,7 +1843,7 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
QDomNodePrivate* QDomNodePrivate::appendChild(QDomNodePrivate* newChild)
{
// No reference manipulation needed. Done in insertAfter.
- return insertAfter(newChild, 0);
+ return insertAfter(newChild, nullptr);
}
QDomDocumentPrivate* QDomNodePrivate::ownerDocument()
@@ -1869,7 +1869,7 @@ QDomNodePrivate* QDomNodePrivate::cloneNode(bool deep)
static void qNormalizeNode(QDomNodePrivate* n)
{
QDomNodePrivate* p = n->first;
- QDomTextPrivate* t = 0;
+ QDomTextPrivate* t = nullptr;
while (p) {
if (p->isText()) {
@@ -1884,7 +1884,7 @@ static void qNormalizeNode(QDomNodePrivate* n)
}
} else {
p = p->next;
- t = 0;
+ t = nullptr;
}
}
}
@@ -2009,8 +2009,8 @@ void QDomNodePrivate::setLocation(int lineNumber, int columnNumber)
Constructs a \l{isNull()}{null} node.
*/
QDomNode::QDomNode()
+ : impl(nullptr)
{
- impl = 0;
}
/*!
@@ -2619,7 +2619,7 @@ bool QDomNode::hasChildNodes() const
{
if (!impl)
return false;
- return IMPL->first != 0;
+ return IMPL->first != nullptr;
}
/*!
@@ -2628,7 +2628,7 @@ bool QDomNode::hasChildNodes() const
*/
bool QDomNode::isNull() const
{
- return (impl == 0);
+ return (impl == nullptr);
}
/*!
@@ -2641,7 +2641,7 @@ void QDomNode::clear()
{
if (impl && !impl->ref.deref())
delete impl;
- impl = 0;
+ impl = nullptr;
}
/*!
@@ -3094,13 +3094,13 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::namedItemNS(const QString& nsURI, cons
return n;
}
}
- return 0;
+ return nullptr;
}
QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItem(QDomNodePrivate* arg)
{
if (readonly || !arg)
- return 0;
+ return nullptr;
if (appendToParent)
return parent->appendChild(arg);
@@ -3115,7 +3115,7 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItem(QDomNodePrivate* arg)
QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItemNS(QDomNodePrivate* arg)
{
if (readonly || !arg)
- return 0;
+ return nullptr;
if (appendToParent)
return parent->appendChild(arg);
@@ -3136,11 +3136,11 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItemNS(QDomNodePrivate* arg)
QDomNodePrivate* QDomNamedNodeMapPrivate::removeNamedItem(const QString& name)
{
if (readonly)
- return 0;
+ return nullptr;
QDomNodePrivate* p = namedItem(name);
- if (p == 0)
- return 0;
+ if (p == nullptr)
+ return nullptr;
if (appendToParent)
return parent->removeChild(p);
@@ -3153,7 +3153,7 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::removeNamedItem(const QString& name)
QDomNodePrivate* QDomNamedNodeMapPrivate::item(int index) const
{
if (index >= length() || index < 0)
- return 0;
+ return nullptr;
return *(map.constBegin() + index);
}
@@ -3164,12 +3164,12 @@ int QDomNamedNodeMapPrivate::length() const
bool QDomNamedNodeMapPrivate::contains(const QString& name) const
{
- return map.value(name) != 0;
+ return map.contains(name);
}
bool QDomNamedNodeMapPrivate::containsNS(const QString& nsURI, const QString & localName) const
{
- return namedItemNS(nsURI, localName) != 0;
+ return namedItemNS(nsURI, localName) != nullptr;
}
/**************************************************************
@@ -3222,8 +3222,8 @@ bool QDomNamedNodeMapPrivate::containsNS(const QString& nsURI, const QString & l
Constructs an empty named node map.
*/
QDomNamedNodeMap::QDomNamedNodeMap()
+ : impl(nullptr)
{
- impl = 0;
}
/*!
@@ -3570,7 +3570,7 @@ QDomNodePrivate* QDomDocumentTypePrivate::removeChild(QDomNodePrivate* oldChild)
QDomNodePrivate* QDomDocumentTypePrivate::appendChild(QDomNodePrivate* newChild)
{
- return insertAfter(newChild, 0);
+ return insertAfter(newChild, nullptr);
}
static QString quotedValue(const QString &data)
@@ -4115,7 +4115,7 @@ QDomAttrPrivate::QDomAttrPrivate(QDomAttrPrivate* n, bool deep)
void QDomAttrPrivate::setNodeValue(const QString& v)
{
value = v;
- QDomTextPrivate *t = new QDomTextPrivate(0, this, v);
+ QDomTextPrivate *t = new QDomTextPrivate(nullptr, this, v);
// keep the refcount balanced: appendChild() does a ref anyway.
t->ref.deref();
if (first) {
@@ -4489,7 +4489,7 @@ void QDomElementPrivate::setAttributeNS(const QString& nsURI, const QString& qNa
void QDomElementPrivate::removeAttribute(const QString& aname)
{
QDomNodePrivate* p = m_attr->removeNamedItem(aname);
- if (p && p->ref.load() == 0)
+ if (p && p->ref.loadRelaxed() == 0)
delete p;
}
@@ -4517,7 +4517,7 @@ QDomAttrPrivate* QDomElementPrivate::setAttributeNode(QDomAttrPrivate* newAttr)
QDomAttrPrivate* QDomElementPrivate::setAttributeNodeNS(QDomAttrPrivate* newAttr)
{
- QDomNodePrivate* n = 0;
+ QDomNodePrivate* n = nullptr;
if (!newAttr->prefix.isNull())
n = m_attr->namedItemNS(newAttr->namespaceURI, newAttr->name);
@@ -5184,10 +5184,10 @@ QDomTextPrivate* QDomTextPrivate::splitText(int offset)
{
if (!parent()) {
qWarning("QDomText::splitText The node has no parent. So I cannot split");
- return 0;
+ return nullptr;
}
- QDomTextPrivate* t = new QDomTextPrivate(ownerDocument(), 0, value.mid(offset));
+ QDomTextPrivate* t = new QDomTextPrivate(ownerDocument(), nullptr, value.mid(offset));
value.truncate(offset);
parent()->insertAfter(t, this);
@@ -6144,7 +6144,7 @@ void QDomProcessingInstruction::setData(const QString& d)
**************************************************************/
QDomDocumentPrivate::QDomDocumentPrivate()
- : QDomNodePrivate(0),
+ : QDomNodePrivate(nullptr),
impl(new QDomImplementationPrivate),
nodeListTime(1)
{
@@ -6155,7 +6155,7 @@ QDomDocumentPrivate::QDomDocumentPrivate()
}
QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname)
- : QDomNodePrivate(0),
+ : QDomNodePrivate(nullptr),
impl(new QDomImplementationPrivate),
nodeListTime(1)
{
@@ -6167,11 +6167,11 @@ QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname)
}
QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentTypePrivate* dt)
- : QDomNodePrivate(0),
+ : QDomNodePrivate(nullptr),
impl(new QDomImplementationPrivate),
nodeListTime(1)
{
- if (dt != 0) {
+ if (dt != nullptr) {
type = dt;
} else {
type = new QDomDocumentTypePrivate(this, this);
@@ -6267,9 +6267,9 @@ QDomElementPrivate* QDomDocumentPrivate::createElement(const QString &tagName)
bool ok;
QString fixedName = fixedXmlName(tagName, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomElementPrivate *e = new QDomElementPrivate(this, 0, fixedName);
+ QDomElementPrivate *e = new QDomElementPrivate(this, nullptr, fixedName);
e->ref.deref();
return e;
}
@@ -6279,16 +6279,16 @@ QDomElementPrivate* QDomDocumentPrivate::createElementNS(const QString &nsURI, c
bool ok;
QString fixedName = fixedXmlName(qName, &ok, true);
if (!ok)
- return 0;
+ return nullptr;
- QDomElementPrivate *e = new QDomElementPrivate(this, 0, nsURI, fixedName);
+ QDomElementPrivate *e = new QDomElementPrivate(this, nullptr, nsURI, fixedName);
e->ref.deref();
return e;
}
QDomDocumentFragmentPrivate* QDomDocumentPrivate::createDocumentFragment()
{
- QDomDocumentFragmentPrivate *f = new QDomDocumentFragmentPrivate(this, (QDomNodePrivate*)0);
+ QDomDocumentFragmentPrivate *f = new QDomDocumentFragmentPrivate(this, (QDomNodePrivate*)nullptr);
f->ref.deref();
return f;
}
@@ -6298,9 +6298,9 @@ QDomTextPrivate* QDomDocumentPrivate::createTextNode(const QString &data)
bool ok;
QString fixedData = fixedCharData(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomTextPrivate *t = new QDomTextPrivate(this, 0, fixedData);
+ QDomTextPrivate *t = new QDomTextPrivate(this, nullptr, fixedData);
t->ref.deref();
return t;
}
@@ -6310,9 +6310,9 @@ QDomCommentPrivate* QDomDocumentPrivate::createComment(const QString &data)
bool ok;
QString fixedData = fixedComment(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomCommentPrivate *c = new QDomCommentPrivate(this, 0, fixedData);
+ QDomCommentPrivate *c = new QDomCommentPrivate(this, nullptr, fixedData);
c->ref.deref();
return c;
}
@@ -6322,9 +6322,9 @@ QDomCDATASectionPrivate* QDomDocumentPrivate::createCDATASection(const QString &
bool ok;
QString fixedData = fixedCDataSection(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomCDATASectionPrivate *c = new QDomCDATASectionPrivate(this, 0, fixedData);
+ QDomCDATASectionPrivate *c = new QDomCDATASectionPrivate(this, nullptr, fixedData);
c->ref.deref();
return c;
}
@@ -6335,13 +6335,13 @@ QDomProcessingInstructionPrivate* QDomDocumentPrivate::createProcessingInstructi
bool ok;
QString fixedData = fixedPIData(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
QString fixedTarget = fixedXmlName(target, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomProcessingInstructionPrivate *p = new QDomProcessingInstructionPrivate(this, 0, fixedTarget, fixedData);
+ QDomProcessingInstructionPrivate *p = new QDomProcessingInstructionPrivate(this, nullptr, fixedTarget, fixedData);
p->ref.deref();
return p;
}
@@ -6350,9 +6350,9 @@ QDomAttrPrivate* QDomDocumentPrivate::createAttribute(const QString &aname)
bool ok;
QString fixedName = fixedXmlName(aname, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, fixedName);
+ QDomAttrPrivate *a = new QDomAttrPrivate(this, nullptr, fixedName);
a->ref.deref();
return a;
}
@@ -6362,9 +6362,9 @@ QDomAttrPrivate* QDomDocumentPrivate::createAttributeNS(const QString &nsURI, co
bool ok;
QString fixedName = fixedXmlName(qName, &ok, true);
if (!ok)
- return 0;
+ return nullptr;
- QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, nsURI, fixedName);
+ QDomAttrPrivate *a = new QDomAttrPrivate(this, nullptr, nsURI, fixedName);
a->ref.deref();
return a;
}
@@ -6374,16 +6374,16 @@ QDomEntityReferencePrivate* QDomDocumentPrivate::createEntityReference(const QSt
bool ok;
QString fixedName = fixedXmlName(aname, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomEntityReferencePrivate *e = new QDomEntityReferencePrivate(this, 0, fixedName);
+ QDomEntityReferencePrivate *e = new QDomEntityReferencePrivate(this, nullptr, fixedName);
e->ref.deref();
return e;
}
QDomNodePrivate* QDomDocumentPrivate::importNode(QDomNodePrivate *importedNode, bool deep)
{
- QDomNodePrivate *node = 0;
+ QDomNodePrivate *node = nullptr;
switch (importedNode->nodeType()) {
case QDomNode::AttributeNode:
node = new QDomAttrPrivate((QDomAttrPrivate*)importedNode, true);
@@ -6435,7 +6435,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod
#if QT_CONFIG(textcodec) && QT_CONFIG(regularexpression)
const QDomNodePrivate* n = first;
- QTextCodec *codec = 0;
+ QTextCodec *codec = nullptr;
if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) {
// we have an XML declaration
@@ -6593,7 +6593,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod
*/
QDomDocument::QDomDocument()
{
- impl = 0;
+ impl = nullptr;
}
/*!
@@ -6822,7 +6822,7 @@ bool QDomDocument::setContent(QXmlInputSource *source, QXmlReader *reader, QStri
{
if (!impl)
impl = new QDomDocumentPrivate();
- return IMPL->setContent(source, reader, 0, errorMsg, errorLine, errorColumn);
+ return IMPL->setContent(source, reader, nullptr, errorMsg, errorLine, errorColumn);
}
/*!
@@ -7369,7 +7369,7 @@ QDomComment QDomNode::toComment() const
QDomHandler::QDomHandler(QDomDocumentPrivate* adoc, QXmlSimpleReader* areader, bool namespaceProcessing)
: errorLine(0), errorColumn(0), doc(adoc), node(adoc), cdata(false),
- nsProcessing(namespaceProcessing), locator(0), reader(areader)
+ nsProcessing(namespaceProcessing), locator(nullptr), reader(areader)
{
}
@@ -7443,7 +7443,7 @@ bool QDomHandler::characters(const QString& ch)
if (cdata) {
n.reset(doc->createCDATASection(ch));
} else if (!entityName.isEmpty()) {
- QScopedPointer<QDomEntityPrivate> e(new QDomEntityPrivate(doc, 0, entityName,
+ QScopedPointer<QDomEntityPrivate> e(new QDomEntityPrivate(doc, nullptr, entityName,
QString(), QString(), QString()));
e->value = ch;
e->ref.deref();
@@ -7528,7 +7528,7 @@ bool QDomHandler::comment(const QString& ch)
bool QDomHandler::unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
{
- QDomEntityPrivate* e = new QDomEntityPrivate(doc, 0, name,
+ QDomEntityPrivate* e = new QDomEntityPrivate(doc, nullptr, name,
publicId, systemId, notationName);
// keep the refcount balanced: appendChild() does a ref anyway.
e->ref.deref();
@@ -7543,7 +7543,7 @@ bool QDomHandler::externalEntityDecl(const QString &name, const QString &publicI
bool QDomHandler::notationDecl(const QString & name, const QString & publicId, const QString & systemId)
{
- QDomNotationPrivate* n = new QDomNotationPrivate(doc, 0, name, publicId, systemId);
+ QDomNotationPrivate* n = new QDomNotationPrivate(doc, nullptr, name, publicId, systemId);
// keep the refcount balanced: appendChild() does a ref anyway.
n->ref.deref();
doc->doctype()->appendChild(n);