Salome HOME
IPAL52935: "Apply and Close" button is not available in "Make 0D Elements on Element...
[modules/smesh.git] / src / SMESH / SMESH_HypoFilter.cxx
index fcebe63d36e8f8b73987123254e26c77504f6a09..a5fd2f45702a5dc5743b2ffb43688a4cfa61debf 100644 (file)
@@ -131,19 +131,22 @@ void SMESH_HypoFilter::IsMoreLocalThanPredicate::findPreferable()
 {
   const int shapeID = _mesh.GetMeshDS()->ShapeToIndex( _shape );
   const TListOfListOfInt& listOfShapeIDList = _mesh.GetMeshOrder();
-  TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin();
+  TListOfListOfInt::const_iterator  listsIt = listOfShapeIDList.begin();
   for ( ; listsIt != listOfShapeIDList.end(); ++listsIt )
   {
-    const TListOfInt& idList  = *listsIt;
+    const TListOfInt& idList = *listsIt;
     TListOfInt::const_iterator idIt =
       std::find( idList.begin(), idList.end(), shapeID );
     if ( idIt != idList.end() && *idIt != idList.front() )
     {
-      for ( ; idIt != idList.end(); --idIt )
+      for ( --idIt; true; --idIt )
       {
         const TopoDS_Shape& shape = _mesh.GetMeshDS()->IndexToShape( *idIt );
         if ( !shape.IsNull())
           _preferableShapes.Add( shape );
+
+        if ( idIt == idList.begin() )
+          break;
       }
     }
   }