mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Minor improvement about using pugixml
This commit is contained in:
@@ -40,9 +40,10 @@ Element * ElementFactory::createElement(const ElementsLocation &location, QGraph
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (location.xml().hasAttribute("link_type"))
|
||||
auto doc = location.pugiXml();
|
||||
if (doc.document_element().attribute("link_type"))
|
||||
{
|
||||
QString link_type = location.xml().attribute("link_type");
|
||||
QString link_type(doc.document_element().attribute("link_type").as_string());
|
||||
if (link_type == "next_report" || link_type == "previous_report") return (new ReportElement(location, link_type, qgi, state));
|
||||
if (link_type == "master") return (new MasterElement (location, qgi, state));
|
||||
if (link_type == "slave") return (new SlaveElement (location, qgi, state));
|
||||
|
||||
Reference in New Issue
Block a user