Bug fix : directory of embedded element collection is not translated

Bug introduced at commit 995066916b5f1c697abc70821750d8ae2364a3b7
This commit is contained in:
Claveau Joshua 2020-10-27 20:49:16 +01:00
parent 50de125787
commit 329ceb4594

View File

@ -24,7 +24,6 @@
#include "element.h" #include "element.h"
#include "qetxml.h" #include "qetxml.h"
#include <QPicture> #include <QPicture>
#include <QDebug>
// make this class usable with QVariant // make this class usable with QVariant
int ElementsLocation::MetaTypeId = qRegisterMetaType<ElementsLocation>("ElementsLocation"); int ElementsLocation::MetaTypeId = qRegisterMetaType<ElementsLocation>("ElementsLocation");
@ -685,19 +684,14 @@ pugi::xml_document ElementsLocation::pugiXml() const
} }
else else
{ {
QString str = m_collection_path;
//Get the xml dom from Qt xml and copie to pugi xml //Get the xml dom from Qt xml and copie to pugi xml
QDomElement element = m_project
->embeddedElementCollection()
->element(str.remove("embed://"));
QDomDocument qdoc; QDomDocument qdoc;
if (isElement()) QString str = m_collection_path;
{ if (isElement()) {
qdoc.appendChild(qdoc.importNode( QDomElement element = m_project->embeddedElementCollection()->element(str.remove("embed://"));
element.firstChildElement( qdoc.appendChild(qdoc.importNode(element.firstChildElement("definition"),true));
"definition"),
true));
} else { } else {
QDomElement element = m_project->embeddedElementCollection()->directory(str.remove("embed://"));
qdoc.appendChild(qdoc.importNode(element, true)); qdoc.appendChild(qdoc.importNode(element, true));
} }
docu.load_string(qdoc.toString(4).toStdString().c_str()); docu.load_string(qdoc.toString(4).toStdString().c_str());