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

(grafted from 660b90b7a2c64837148237902a3fb11e73ef49f0)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-12-20 16:43:18 +02:00
parent c782bf37db
commit ac6224d2df

View File

@ -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<quint32, QDomElement> tmpCache;
if (VDomDocument::find(tmpCache, this->documentElement(), id))
{
m_elementIdCache = tmpCache;
return m_elementIdCache.value(id);
}
m_elementIdCache = tmpCache;
}
else
{