From 329ceb4594dd15e81d45a35374ffe11b193ce667 Mon Sep 17 00:00:00 2001 From: Claveau Joshua Date: Tue, 27 Oct 2020 20:49:16 +0100 Subject: [PATCH] Bug fix : directory of embedded element collection is not translated Bug introduced at commit 995066916b5f1c697abc70821750d8ae2364a3b7 --- .../ElementsCollection/elementslocation.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index e1fb167c0..4d0bf598d 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -24,7 +24,6 @@ #include "element.h" #include "qetxml.h" #include -#include // make this class usable with QVariant int ElementsLocation::MetaTypeId = qRegisterMetaType("ElementsLocation"); @@ -685,19 +684,14 @@ pugi::xml_document ElementsLocation::pugiXml() const } else { - QString str = m_collection_path; - //Get the xml dom from Qt xml and copie to pugi xml - QDomElement element = m_project - ->embeddedElementCollection() - ->element(str.remove("embed://")); + //Get the xml dom from Qt xml and copie to pugi xml QDomDocument qdoc; - if (isElement()) - { - qdoc.appendChild(qdoc.importNode( - element.firstChildElement( - "definition"), - true)); + QString str = m_collection_path; + if (isElement()) { + QDomElement element = m_project->embeddedElementCollection()->element(str.remove("embed://")); + qdoc.appendChild(qdoc.importNode(element.firstChildElement("definition"),true)); } else { + QDomElement element = m_project->embeddedElementCollection()->directory(str.remove("embed://")); qdoc.appendChild(qdoc.importNode(element, true)); } docu.load_string(qdoc.toString(4).toStdString().c_str());