diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 3605e8335..c7a9ee5a1 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -698,7 +698,7 @@ bool VDomDocument::setTagText(const QString &tag, const QString &text) if (domNode.isNull() == false && domNode.isElement()) { const QDomElement domElement = domNode.toElement(); - setTagText(domElement, text); + return setTagText(domElement, text); } } return false; @@ -711,11 +711,10 @@ bool VDomDocument::setTagText(const QDomElement &domElement, const QString &text { QDomElement parent = domElement.parentNode().toElement(); QDomElement newTag = createElement(domElement.tagName()); - if (not text.isEmpty()) - { - const QDomText newTagText = createTextNode(text); - newTag.appendChild(newTagText); - } + + const QDomText newTagText = createTextNode(text); + newTag.appendChild(newTagText); + parent.replaceChild(newTag, domElement); return true; }