From ac6224d2dfa3307855af7c927a89c203266da407 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 20 Dec 2018 16:43:18 +0200 Subject: [PATCH] Because VDomDocument::find checks for unique id we must use temp cache. ref #905 (grafted from 660b90b7a2c64837148237902a3fb11e73ef49f0) --HG-- branch : develop --- src/libs/ifc/xml/vdomdocument.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index a9acc8b00..f4444b476 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -232,10 +232,14 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName) if (tagName.isEmpty()) { - if (VDomDocument::find(m_elementIdCache, this->documentElement(), id)) + // Because VDomDocument::find checks for unique id we must use temp cache + QHash tmpCache; + if (VDomDocument::find(tmpCache, this->documentElement(), id)) { - return m_elementIdCache.value(id); + m_elementIdCache = tmpCache; + return m_elementIdCache.value(id); } + m_elementIdCache = tmpCache; } else {