]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
23155: [CEA 1578] Sauv2med fails during the creation of groups there are several...
authoreap <eap@opencascade.com>
Tue, 8 Sep 2015 11:47:10 +0000 (14:47 +0300)
committereap <eap@opencascade.com>
Tue, 8 Sep 2015 11:47:10 +0000 (14:47 +0300)
src/MEDLoader/SauvMedConvertor.cxx

index 28a54e390f0a7d210e5ae38f8f54e529fdf3e63e..dd2ba8961f036eca1796a3ed1aedc2fd11a80c4c 100644 (file)
@@ -3265,8 +3265,11 @@ void IntermediateMED::setGroups( ParaMEDMEM::MEDFileUMesh* mesh )
           // Issue 0021311. Use case: a gibi group has references (recorded in pile 1)
           // and several names (pile 27) refer (pile 10) to this group.
           // We create a copy of this group per each named reference
+          std::set<std::string> uniqueNames;
+          uniqueNames.insert( grp._name );
           for ( unsigned iRef = 0 ; iRef < grp._refNames.size(); ++iRef )
-            if ( !grp._refNames[ iRef ].empty() )
+            if ( !grp._refNames[ iRef ].empty() &&
+                 uniqueNames.insert( grp._refNames[ iRef ]).second ) // for name uniqueness (23155)
               {
                 refGroups.push_back( grp._medGroup->deepCpy() );
                 refGroups.back()->setName( grp._refNames[ iRef ].c_str() );