]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correct dump of default name of results
authorazv <azv@opencascade.com>
Mon, 22 Aug 2016 09:26:43 +0000 (12:26 +0300)
committerazv <azv@opencascade.com>
Mon, 22 Aug 2016 09:26:43 +0000 (12:26 +0300)
src/ModelHighAPI/ModelHighAPI_Dumper.cpp

index 52b9fab366d46cf51972c15c6706d6db34cdc688..3799f614f9480808a208b22662a8ad96206d4d04 100644 (file)
@@ -127,14 +127,16 @@ const std::string& ModelHighAPI_Dumper::name(const EntityPtr& theEntity,
       }
       aDefaultName << aKind << "_" << aFullIndex;
     }
-
-    // store names of results
-    saveResultNames(aFeature);
   }
 
   myNames[theEntity] = std::pair<std::string, std::string>(aDefaultName.str(), aName);
   if (theSaveNotDumped)
     myNotDumpedEntities.insert(theEntity);
+
+  // store names of results
+  if (aFeature)
+    saveResultNames(aFeature);
+
   return myNames[theEntity].first;
 }
 
@@ -155,7 +157,7 @@ const std::string& ModelHighAPI_Dumper::parentName(const FeaturePtr& theEntity)
 
 void ModelHighAPI_Dumper::saveResultNames(const FeaturePtr& theFeature)
 {
-  std::string aFeatureName = theFeature->name();
+  const std::string& aFeatureName = myNames[theFeature].first;
   const std::list<ResultPtr>& aResults = theFeature->results();
   std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
   for (int i = 1; aResIt != aResults.end(); ++aResIt, ++i) {