Salome HOME
23250: [CEA 1766] 3D tab is empty when editing mesh
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshDlg.cxx
index 4973a5d1ebe264ae5894f53b262e7bed94c6ee21..253ef61b3696e3bfd287ce58627ea42204fbe6e9 100644 (file)
@@ -338,17 +338,24 @@ void SMESHGUI_MeshTab::setCurrentHyp( const int theId, const int theIndex )
   }
   else // more than one additional hyp assigned
   {
-    // move a hyp from myHypCombo[ AddHyp ] to myAddHypList
-    for ( int i = 1, nb = myHypCombo[ AddHyp ]->count(); i < nb; ++i )
+    if ( theIndex > 0 )
     {
-      int curIndex = myHypCombo[ AddHyp ]->itemData( i ).toInt();
-      if ( theIndex == curIndex )
+      // move a hyp from myHypCombo[ AddHyp ] to myAddHypList
+      for ( int i = 1, nb = myHypCombo[ AddHyp ]->count(); i < nb; ++i )
       {
-        addItem( myHypCombo[ AddHyp ]->itemText( i ), theId, theIndex );
-        myHypCombo[ AddHyp ]->removeItem( i );
-        break;
+        int curIndex = myHypCombo[ AddHyp ]->itemData( i ).toInt();
+        if ( theIndex == curIndex )
+        {
+          addItem( myHypCombo[ AddHyp ]->itemText( i ), theId, theIndex );
+          myHypCombo[ AddHyp ]->removeItem( i );
+          break;
+        }
       }
     }
+    else
+    {
+      myAddHypList->clear();
+    }
   }
 }