Fix error in VDomDocument::elementById.
Searching in cache did not check tag if provided.
This commit is contained in:
parent
b756460da8
commit
4fa2b76f01
|
@ -273,11 +273,21 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName, bool u
|
||||||
|
|
||||||
if (m_elementIdCache.contains(id))
|
if (m_elementIdCache.contains(id))
|
||||||
{
|
{
|
||||||
const QDomElement e = m_elementIdCache.value(id);
|
const QDomElement e = m_elementIdCache.value(id);
|
||||||
if (e.parentNode().nodeType() != QDomNode::BaseNode)
|
if (e.parentNode().nodeType() != QDomNode::BaseNode)
|
||||||
{
|
{
|
||||||
return e;
|
if (not tagName.isEmpty())
|
||||||
}
|
{
|
||||||
|
if (e.tagName() == tagName)
|
||||||
|
{
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateCache)
|
if (updateCache)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user