X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_WidgetReader.cpp;h=c8ea412d88f56bf539534ffa743644c20b931b02;hb=22df2f3d52b661c4cffef91085300cffc02dfa65;hp=f0214657bb339201c81a8ee1d5fda147189b4838;hpb=036ba4eb4c2df048fd651a54f68882a01769eb08;p=modules%2Fshaper.git diff --git a/src/Config/Config_WidgetReader.cpp b/src/Config/Config_WidgetReader.cpp index f0214657b..c8ea412d8 100644 --- a/src/Config/Config_WidgetReader.cpp +++ b/src/Config/Config_WidgetReader.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Config_WidgetReader.cpp * @@ -20,7 +22,6 @@ #include #endif - Config_WidgetReader::Config_WidgetReader(const std::string& theXmlFile) : Config_XMLReader(theXmlFile) @@ -41,7 +42,6 @@ std::string Config_WidgetReader::featureDescription(const std::string& theFeatur return myDescriptionCache[theFeatureName]; } - void Config_WidgetReader::processNode(xmlNodePtr theNode) { if (isNode(theNode, NODE_FEATURE, NULL)) { @@ -56,34 +56,35 @@ void Config_WidgetReader::processNode(xmlNodePtr theNode) bool Config_WidgetReader::processChildren(xmlNodePtr theNode) { //Read all nodes recursively, source and validator nodes have no children - return !isNode(theNode, NODE_VALIDATOR, NODE_SOURCE, NULL); + return !isNode(theNode, NODE_VALIDATOR, + NODE_SELFILTER, + NODE_SOURCE, NULL); } void Config_WidgetReader::resolveSourceNodes(xmlNodePtr theNode) { xmlNodePtr aNode = xmlFirstElementChild(theNode); std::list aSourceNodes; - while(aNode != NULL) { + while (aNode != NULL) { if (isNode(aNode, NODE_SOURCE, NULL)) { Config_XMLReader aSourceReader = Config_XMLReader(getProperty(aNode, SOURCE_FILE)); xmlNodePtr aSourceRoot = aSourceReader.findRoot(); - if (!aSourceRoot) { - continue; - } - xmlNodePtr aSourceNode = xmlFirstElementChild(aSourceRoot); - xmlNodePtr aTargetNode = xmlDocCopyNodeList(aNode->doc, aSourceNode); - while(aTargetNode != NULL) { - xmlNodePtr aNextNode = xmlNextElementSibling(aTargetNode); - xmlAddPrevSibling(aNode, aTargetNode); - aTargetNode = aNextNode; + if (aSourceRoot) { + xmlNodePtr aSourceNode = xmlFirstElementChild(aSourceRoot); + xmlNodePtr aTargetNode = xmlDocCopyNodeList(aNode->doc, aSourceNode); + while (aTargetNode != NULL) { + xmlNodePtr aNextNode = xmlNextElementSibling(aTargetNode); + xmlAddPrevSibling(aNode, aTargetNode); + aTargetNode = aNextNode; + } + aSourceNodes.push_back(aNode); } - aSourceNodes.push_back(aNode); } aNode = xmlNextElementSibling(aNode); } //Remove "SOURCE" node. std::list::iterator it = aSourceNodes.begin(); - for(; it != aSourceNodes.end(); it++) { + for (; it != aSourceNodes.end(); it++) { xmlUnlinkNode(*it); xmlFreeNode(*it); }