Salome HOME
Reverted to SALOME current CMake build procedure.
[tools/medcoupling.git] / src / MEDLoader / SauvMedConvertor.cxx
index 28a54e390f0a7d210e5ae38f8f54e529fdf3e63e..8972744a409c2bef28d39a28750ff147809f2606 100644 (file)
@@ -46,6 +46,7 @@
 #endif
 
 #ifdef HAS_XDR
+#include <rpc/types.h>
 #include <rpc/xdr.h>
 #endif
 
@@ -209,7 +210,7 @@ namespace
    */
   struct TCellByIDCompare
   {
-    bool operator () (const Cell* i1, const Cell* i2)
+    bool operator () (const Cell* i1, const Cell* i2) const
     {
       return i1->_number < i2->_number;
     }
@@ -3265,8 +3266,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() );