From 9656b3b76203fe83434376f41afbdc4c7b0b84b3 Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 8 Jul 2015 18:35:42 +0300 Subject: [PATCH] Issue #723 - Different workbenches with diferent "document" attribute --- src/Config/Config_FeatureReader.cpp | 2 +- src/Config/Config_XMLReader.cpp | 4 ++-- src/Config/Config_XMLReader.h | 2 +- src/FeaturesPlugin/plugin-Features.xml | 26 +++++++++++++------------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 8a3b5f19b..7bf841b06 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -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)) { diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index c0a0a2ee0..b6bbc0ecc 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -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; } } diff --git a/src/Config/Config_XMLReader.h b/src/Config/Config_XMLReader.h index d19bd8467..6cfefc62d 100644 --- a/src/Config/Config_XMLReader.h +++ b/src/Config/Config_XMLReader.h @@ -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. diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index d9437f131..6772d2bda 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -1,19 +1,6 @@ - - - - - - - - - - - - - @@ -51,4 +38,17 @@ + + + + + + + + + + + + + -- 2.30.2