*/
QXmlItem::QXmlItem()
{
- m_node.model = 0;
- m_node.data = 0;
- m_node.additionalData = 0;
+ m_node.reset();
}
bool QXmlItem::internalIsAtomicValue() const
*/
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;
}
m_node.model = reinterpret_cast<const QAbstractXmlNodeModel *>(~0);
m_atomicValue = temp.asAtomicValue();
}
- else
- {
- m_atomicValue = 0;
- m_node.model = 0;
- }
-
- m_node.additionalData = 0;
}
/*!
*/
inline Item()
{
- /* Note that this function should be equal to reset(). */
-
- /* This is the area which atomicValue uses. Becauase we want as()
- * to return null on null-constructed objects, we initialize it. */
- node.data = 0;
-
- /* This signals that we're not an atomic value. */
- node.model = 0;
+ reset();
}
inline Item(const QXmlNodeModelIndex &n) : node(n.m_storage)
inline Item(const AtomicValue::Ptr &a)
{
+ reset();
if(a)
{
atomicValue = a.data();
/* Signal that we're housing an atomic value. */
node.model = reinterpret_cast<const QAbstractXmlNodeModel *>(~0);
}
- else
- node.model = 0; /* Like the default constructor. */
}
inline Item(const AtomicValue *const a)
{
/* Note, the implementation is a copy of the constructor above. */
-
+ reset();
if(a)
{
atomicValue = a;
/* Signal that we're housing an atomic value. */
node.model = reinterpret_cast<const QAbstractXmlNodeModel *>(~0);
}
- else
- node.model = 0; /* Like the default constructor. */
}
inline ~Item()
inline void reset()
{
- /* Note that this function should be equal to the default
- * constructor. */
- node.model = 0;
- node.data = 0;
+ node.reset();
}
static inline Item fromPublic(const QXmlItem &i)