]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
avoid adding a shape with empty name to the myNamesShape map mbs/StepImport
authormbs <martin.bernhard@opencascade.com>
Wed, 17 May 2023 13:55:14 +0000 (14:55 +0100)
committermbs <martin.bernhard@opencascade.com>
Wed, 17 May 2023 13:55:14 +0000 (14:55 +0100)
src/Model/Model_ResultBody.cpp

index 96f2aad2ef2ab280d2f9105894f2b92ebf7e8430..195b44af6cc1c42842a2ca6f1a9cc1905a95ed24 100644 (file)
@@ -249,18 +249,18 @@ void Model_ResultBody::addShapeColor( const std::wstring& theName,std::vector<in
     myColorsShape[ theName ] =  color;
 }
 
-std::wstring Model_ResultBody::addShapeName(std::shared_ptr<GeomAPI_Shape> theshape,
+std::wstring Model_ResultBody::addShapeName(std::shared_ptr<GeomAPI_Shape> theShape,
                                             const std::wstring& theName ){
 
   int indice = 1;
   std::wstringstream aName;
   aName << theName;
-  while(myNamesShape.find(aName.str()) != myNamesShape.end() ){
+  while(aName.str().empty() || myNamesShape.find(aName.str()) != myNamesShape.end() ){
     aName.str(L"");
     aName << theName << L"__" << indice;
     indice++;
   }
-  myNamesShape[ aName.str() ] = theshape;
+  myNamesShape[ aName.str() ] = theShape;
 
   return aName.str();
 }