Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / Config / Config_WidgetReader.cpp
index 3558c659652307e27ab1bf6ac314cc1d31bc8121..032acb000dba27983941511ed518c3670bd3d68c 100644 (file)
@@ -8,10 +8,10 @@
 #include <Config_WidgetReader.h>
 #include <Config_Keywords.h>
 
-#include <libxml\parser.h>
-#include <libxml\tree.h>
-#include <libxml\xpath.h>
-#include <libxml\xmlstring.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <libxml/xmlstring.h>
 
 #ifdef _DEBUG
 #include <iostream>
@@ -36,10 +36,14 @@ std::string Config_WidgetReader::featureWidgetCfg(std::string theFeatureName)
 void Config_WidgetReader::processNode(xmlNodePtr theNode)
 {
   if (isNode(theNode, NODE_FEATURE, NULL)) {
-    xmlBufferPtr buffer = xmlBufferCreate();
-    int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 1);
+    std::string result = "";
     std::string aNodeName = getProperty(theNode, _ID);
-    myWidgetCache[aNodeName] = std::string((char*) buffer->content);
+    if (hasChild(theNode)) {
+      xmlBufferPtr buffer = xmlBufferCreate();
+      int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 1);
+      result = std::string((char*) buffer->content);
+    }
+    myWidgetCache[aNodeName] = result;
   }
 }