Salome HOME
Merge from V6_4_BR 05/12/2011
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreatePolyhedralVolumeDlg.cxx
index aef376bc9764e0c01e8802698a3137af99933a0b..835d24066d637bd1fdd0d79728ef45f3520a5c8b 100644 (file)
@@ -259,6 +259,7 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
   TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
   ComboBox_GroupName = new QComboBox( GroupGroups );
   ComboBox_GroupName->setEditable( true );
+  ComboBox_GroupName->setInsertPolicy( QComboBox::NoInsert );
 
   GroupGroupsLayout->addWidget( TextLabel_GroupName );
   GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
@@ -462,7 +463,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
           if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
             idx = i;
         }
-        if ( idx > 0 ) {
+        if ( idx > 0 && idx < myGroups.count() ) {
           SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
           if ( !aGeomGroup->_is_nil() ) {
             int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),