From 66c1c5d611878fadc19b6f89158bf1b5ec769e5a Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 27 Dec 2016 18:17:18 +0300 Subject: [PATCH] Recover feature is dumped without "setName" (issue #1930) Do not add to stack already dumped feature. --- src/ModelHighAPI/ModelHighAPI_Dumper.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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); -- 2.39.2