Fixed tests.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-04-07 12:35:08 +03:00
parent 0759dba4ac
commit 5697af33e8

View File

@ -698,7 +698,7 @@ bool VDomDocument::setTagText(const QString &tag, const QString &text)
if (domNode.isNull() == false && domNode.isElement()) if (domNode.isNull() == false && domNode.isElement())
{ {
const QDomElement domElement = domNode.toElement(); const QDomElement domElement = domNode.toElement();
setTagText(domElement, text); return setTagText(domElement, text);
} }
} }
return false; return false;
@ -711,11 +711,10 @@ bool VDomDocument::setTagText(const QDomElement &domElement, const QString &text
{ {
QDomElement parent = domElement.parentNode().toElement(); QDomElement parent = domElement.parentNode().toElement();
QDomElement newTag = createElement(domElement.tagName()); QDomElement newTag = createElement(domElement.tagName());
if (not text.isEmpty())
{ const QDomText newTagText = createTextNode(text);
const QDomText newTagText = createTextNode(text); newTag.appendChild(newTagText);
newTag.appendChild(newTagText);
}
parent.replaceChild(newTag, domElement); parent.replaceChild(newTag, domElement);
return true; return true;
} }