From b8e4fca09f47ef02d04e45323db058966ebc8938 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Sat, 8 Feb 2025 07:39:21 +0100 Subject: [PATCH] fix: remove empty elementInformation, but keep empty properties --- sources/diagramcontext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/diagramcontext.cpp b/sources/diagramcontext.cpp index 864ad9b3a..681fed49e 100644 --- a/sources/diagramcontext.cpp +++ b/sources/diagramcontext.cpp @@ -151,7 +151,10 @@ bool DiagramContext::operator!=(const DiagramContext &dc) const void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const { foreach (QString key, keys()) { - if (m_content[key].toString().trimmed().isEmpty()) { continue; } + if ((tag_name == "elementInformation") && + (m_content[key].toString().trimmed().isEmpty())) { + continue; + } QDomElement property = e.ownerDocument().createElement(tag_name); // try to sort attributes by removing and re-adding property.removeAttribute("show");