From: azv Date: Tue, 27 Dec 2016 15:17:18 +0000 (+0300) Subject: Recover feature is dumped without "setName" (issue #1930) X-Git-Tag: V_2.7.0~351^2~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66c1c5d611878fadc19b6f89158bf1b5ec769e5a;p=modules%2Fshaper.git Recover feature is dumped without "setName" (issue #1930) Do not add to stack already dumped feature. --- diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index effc2d1d3..180b5c16f 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -624,18 +624,21 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<( ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const FeaturePtr& theEntity) { + bool isFound = myNames.find(theEntity) != myNames.end(); myDumpBuffer << name(theEntity); - bool isUserDefinedName = !myNames[theEntity].myIsDefault; - // store results if they have user-defined names or colors - std::list aResultsWithNameOrColor; - const std::list& aResults = theEntity->results(); - std::list::const_iterator aResIt = aResults.begin(); - for (; aResIt != aResults.end(); ++aResIt) - if (!myNames[*aResIt].myIsDefault || !isDefaultColor(*aResIt) || !isDefaultDeflection(*aResIt)) - aResultsWithNameOrColor.push_back(*aResIt); - // store just dumped entity to stack - myEntitiesStack.push(LastDumpedEntity(theEntity, isUserDefinedName, aResultsWithNameOrColor)); + if (!isFound) { + bool isUserDefinedName = !myNames[theEntity].myIsDefault; + // store results if they have user-defined names or colors + std::list aResultsWithNameOrColor; + const std::list& aResults = theEntity->results(); + std::list::const_iterator aResIt = aResults.begin(); + for (; aResIt != aResults.end(); ++aResIt) + if (!myNames[*aResIt].myIsDefault || !isDefaultColor(*aResIt) || !isDefaultDeflection(*aResIt)) + aResultsWithNameOrColor.push_back(*aResIt); + // store just dumped entity to stack + myEntitiesStack.push(LastDumpedEntity(theEntity, isUserDefinedName, aResultsWithNameOrColor)); + } // remove entity from the list of not dumped items myNotDumpedEntities.erase(theEntity);