summaryrefslogtreecommitdiff
path: root/src/xmlpatterns/functions/qgenerateidfn.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-21 12:26:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-04-13 10:37:04 +0000
commite4abf2c6e3de158d3a6eb3c46b5158f741136c9d (patch)
tree97874eba77025fd33f9962e723465f9591798871 /src/xmlpatterns/functions/qgenerateidfn.cpp
parent3bada53c09f226398bcdeddfd633fd6df7c42ff7 (diff)
downloadqtxmlpatterns-e4abf2c6e3de158d3a6eb3c46b5158f741136c9d.tar.gz
Fix developer build with new GCCv5.11.0-beta4
Avoid casting to a possibly null QXmlNodeModelIndex as that now can cause -Wunitialized warnings. Change-Id: Id53d213f90e9845f6e4b4e9ada5945726750ec86 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/xmlpatterns/functions/qgenerateidfn.cpp')
-rw-r--r--src/xmlpatterns/functions/qgenerateidfn.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/xmlpatterns/functions/qgenerateidfn.cpp b/src/xmlpatterns/functions/qgenerateidfn.cpp
index b4264ae..f85381e 100644
--- a/src/xmlpatterns/functions/qgenerateidfn.cpp
+++ b/src/xmlpatterns/functions/qgenerateidfn.cpp
@@ -47,11 +47,12 @@ using namespace QPatternist;
Item GenerateIDFN::evaluateSingleton(const DynamicContext::Ptr &context) const
{
- const QXmlNodeModelIndex &node = m_operands.first()->evaluateSingleton(context).asNode();
-
- if(node.isNull())
+ const Item item = m_operands.first()->evaluateSingleton(context);
+ if (item.isNull())
return AtomicString::fromValue(QString());
+ const QXmlNodeModelIndex &node = item.asNode();
+
return AtomicString::fromValue(QLatin1Char('T')
+ QString::number(qptrdiff(node.model()))
+ QString::number(qptrdiff(node.internalPointer()))