Salome HOME
Issue #723 - Different workbenches with diferent "document" attribute
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 8 Jul 2015 15:35:42 +0000 (18:35 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 8 Jul 2015 15:36:29 +0000 (18:36 +0300)
src/Config/Config_FeatureReader.cpp
src/Config/Config_XMLReader.cpp
src/Config/Config_XMLReader.h
src/FeaturesPlugin/plugin-Features.xml

index 8a3b5f19b4548361cdc8423271dd4e55dfcfe6b7..7bf841b060b7c0ee9f3e41a2ead85aa63c947f5b 100644 (file)
@@ -60,7 +60,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
     //The m_last* variables always defined before fillFeature() call. XML is a tree.
   } else if (isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL)) {
     storeAttribute(theNode, _ID);
-    storeAttribute(theNode, WORKBENCH_DOC);
+    storeAttribute(theNode, WORKBENCH_DOC, true);
   } else if (myIsProcessWidgets) {
     // widgets, like shape_selector or containers, like toolbox
     if (isAttributeNode(theNode)) {
index c0a0a2ee0a0e4beac70cd5f8fec2f7ea4d2e8004..b6bbc0ecc3cb98a2ea4759f3b3957620541404df 100644 (file)
@@ -144,11 +144,11 @@ std::string Config_XMLReader::getNodeName(xmlNodePtr theNode)
   return result;
 }
 
-void Config_XMLReader::storeAttribute(xmlNodePtr theNode, const char* theAttribute)
+void Config_XMLReader::storeAttribute(xmlNodePtr theNode, const char* theAttribute, bool doClean)
 {
   std::string aKey = getNodeName(theNode) + ":" + std::string(theAttribute);
   std::string aValue = getProperty(theNode, theAttribute);
-  if(!aValue.empty()) {
+  if (doClean || !aValue.empty()) {
     myCachedAttributes[aKey] = aValue;
   }
 }
index d19bd8467a482517d7602cb4b33e0bc595593ef7..6cfefc62d854f96122b361d48e47a42b9a048212 100644 (file)
@@ -87,7 +87,7 @@ class Config_XMLReader
   std::string getNodeName(xmlNodePtr theNode);
   /// Stores an attribute in internal map for later use.
   /// Key is "Node_Name:Node_Attribute" and value is getProperty(theNodeAttribute)
-  void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute);
+  void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute, bool doClean = false);
   /// Restores an attribute from internal map.
   std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute);
   /// Restores an attribute from internal map.
index d9437f1310f6f372b18b2b4c3c3cfaa7e4b4147a..6772d2bda9103262c9aa0fdeedce6acf651534b8 100644 (file)
@@ -1,19 +1,6 @@
 <!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
 
 <plugin>
-  <workbench id="Movement">
-    <group id="Basic">
-      <feature id="Placement" title="Placement" tooltip="Perform moving of an object to specified position" icon=":icons/placement.png">
-        <source path="placement_widget.xml"/>
-      </feature>
-      <feature id="Movement" title="Movement" tooltip="Perform movement of an objects along the axis to specified distance" icon=":icons/movement.png">
-        <source path="movement_widget.xml"/>
-      </feature>
-      <feature id="Rotation" title="Rotation" tooltip="Perform rotation of an objects around the axis to specified angle" icon=":icons/rotation.png">
-        <source path="rotation_widget.xml"/>
-      </feature>
-    </group>
-  </workbench>
   <workbench id="Features" document="Part">
     <group id="Extrusion">
       <feature id="Extrusion" title="Extrusion" tooltip="Create a solid by extrusion of a face" icon=":icons/extrusion.png">
       </feature>
     </group>
   </workbench>
+  <workbench id="Features">
+    <group id="Basic">
+      <feature id="Placement" title="Placement" tooltip="Perform moving of an object to specified position" icon=":icons/placement.png">
+        <source path="placement_widget.xml"/>
+      </feature>
+      <feature id="Movement" title="Movement" tooltip="Perform movement of an objects along the axis to specified distance" icon=":icons/movement.png">
+        <source path="movement_widget.xml"/>
+      </feature>
+      <feature id="Rotation" title="Rotation" tooltip="Perform rotation of an objects around the axis to specified angle" icon=":icons/rotation.png">
+        <source path="rotation_widget.xml"/>
+      </feature>
+    </group>
+  </workbench>
 </plugin>