X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_WidgetReader.cpp;h=7ba92f9961f5f6b7a5d7e08f4e2fd54ff1e8b29d;hb=2b4f4bf278c841500eb29bb5d204690427b0d56b;hp=8f47a62007bf55be12b8fd4039af25843a183480;hpb=dcc3de2b3137a37fc2ecbc3bc856079877a1c1c7;p=modules%2Fshaper.git diff --git a/src/Config/Config_WidgetReader.cpp b/src/Config/Config_WidgetReader.cpp index 8f47a6200..7ba92f996 100644 --- a/src/Config/Config_WidgetReader.cpp +++ b/src/Config/Config_WidgetReader.cpp @@ -39,22 +39,39 @@ std::string Config_WidgetReader::featureDescription(const std::string& theFeatur return myDescriptionCache[theFeatureName]; } + void Config_WidgetReader::processNode(xmlNodePtr theNode) { if (isNode(theNode, NODE_FEATURE, NULL)) { - std::string result = ""; std::string aNodeName = getProperty(theNode, _ID); - if (hasChild(theNode)) { - xmlBufferPtr buffer = xmlBufferCreate(); - int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 1); - result = std::string((char*) buffer->content); - } - myWidgetCache[aNodeName] = result; + myWidgetCache[aNodeName] = dumpNode(theNode);; myDescriptionCache[aNodeName] = getProperty(theNode, FEATURE_TEXT); } + //Process SOURCE nodes. + Config_XMLReader::processNode(theNode); } bool Config_WidgetReader::processChildren(xmlNodePtr theNode) { return isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL); } + +std::string Config_WidgetReader::dumpNode(xmlNodePtr theNode) +{ + std::string result = ""; + if (!hasChild(theNode)) { + return result; + } + xmlNodePtr aChildrenNode = xmlFirstElementChild(theNode); + xmlBufferPtr buffer = xmlBufferCreate(); + if (isNode(aChildrenNode, NODE_SOURCE, NULL)) { + Config_XMLReader aSourceReader = + Config_XMLReader(getProperty(aChildrenNode, SOURCE_FILE)); + xmlNodePtr aSourceRoot = aSourceReader.findRoot(); + int size = xmlNodeDump(buffer, aSourceRoot->doc, aSourceRoot, 0, 1); + } else { + int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 1); + } + result = std::string((char*) (buffer->content)); + return result; +}