diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index df1b0061c..cd0733d4c 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -273,11 +273,21 @@ QDomElement VDomDocument::elementById(quint32 id, const QString &tagName, bool u if (m_elementIdCache.contains(id)) { - const QDomElement e = m_elementIdCache.value(id); - if (e.parentNode().nodeType() != QDomNode::BaseNode) - { - return e; - } + const QDomElement e = m_elementIdCache.value(id); + if (e.parentNode().nodeType() != QDomNode::BaseNode) + { + if (not tagName.isEmpty()) + { + if (e.tagName() == tagName) + { + return e; + } + } + else + { + return e; + } + } } if (updateCache)