diff options
Diffstat (limited to 'src/xmlpatterns/api')
-rw-r--r-- | src/xmlpatterns/api/qabstractxmlnodemodel.cpp | 11 | ||||
-rw-r--r-- | src/xmlpatterns/api/qabstractxmlnodemodel.h | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp index 81c6473..e0a04f7 100644 --- a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp @@ -1138,9 +1138,7 @@ bool QAbstractXmlNodeModel::isDeepEqual(const QXmlNodeModelIndex &n1, */ QXmlItem::QXmlItem() { - m_node.model = 0; - m_node.data = 0; - m_node.additionalData = 0; + m_node.reset(); } bool QXmlItem::internalIsAtomicValue() const @@ -1164,12 +1162,10 @@ QXmlItem::QXmlItem(const QXmlItem &other) : m_node(other.m_node) */ QXmlItem::QXmlItem(const QVariant &atomicValue) { + m_node.reset(); if(atomicValue.isNull()) { /* Then we behave just like the default constructor. */ - m_node.model = 0; - m_node.data = 0; - m_node.additionalData = 0; return; } @@ -1188,10 +1184,7 @@ QXmlItem::QXmlItem(const QVariant &atomicValue) else { m_atomicValue = 0; - m_node.model = 0; } - - m_node.additionalData = 0; } /*! diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.h b/src/xmlpatterns/api/qabstractxmlnodemodel.h index f8663ed..8c2f7ec 100644 --- a/src/xmlpatterns/api/qabstractxmlnodemodel.h +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.h @@ -105,6 +105,13 @@ namespace QPatternist /* Implementation is in qabstractxmlnodemodel.cpp. */ inline bool operator!=(const NodeIndexStorage &other) const; + + void reset() + { + data = 0; + additionalData = 0; + model = 0; + } }; } @@ -217,9 +224,7 @@ public: inline void reset() { - m_storage.data = 0; - m_storage.additionalData = 0; - m_storage.model = 0; + m_storage.reset(); } private: |