Because VDomDocument::find checks for unique id we must use temp cache. ref #905

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2018-12-20 16:43:18 +02:00
parent a087e9ea74
commit 989a16b789

View File

@ -231,10 +231,14 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName)
if (tagName.isEmpty()) if (tagName.isEmpty())
{ {
if (VDomDocument::find(m_elementIdCache, this->documentElement(), id)) // Because VDomDocument::find checks for unique id we must use temp cache
QHash<quint32, QDomElement> 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 else
{ {