From: eap Date: Mon, 13 Aug 2012 09:03:54 +0000 (+0000) Subject: 0021799: EDF 2344 SMESH: Existing groups are not taken into account when adding new... X-Git-Tag: V6_6_0a1~209 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=7c8ba54a1a59535e9fd227321a0f612d2931eea0 0021799: EDF 2344 SMESH: Existing groups are not taken into account when adding new elements into groups --- diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 2febf76f8..4ce7522d5 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -498,12 +498,12 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() int idx = 0; if( addToGroup ) { aGroupName = ComboBox_GroupName->currentText(); - for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { + for ( int i = 1; i <= ComboBox_GroupName->count(); i++ ) { QString aName = ComboBox_GroupName->itemText( i ); if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) idx = i; } - if ( idx > 0 && idx < myGroups.count() ) { + 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" ), diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index 0472de715..c4bc516ad 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -711,12 +711,12 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply() int idx = 0; if( addToGroup ) { aGroupName = ComboBox_GroupName->currentText(); - for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { + for ( int i = 1; i <= ComboBox_GroupName->count(); i++ ) { QString aName = ComboBox_GroupName->itemText( i ); if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) idx = i; } - if ( idx > 0 && idx < myGroups.count() ) { + 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" ), diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index ffc22ecdb..73eae4dd2 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -458,12 +458,12 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() int idx = 0; if( addToGroup ) { aGroupName = ComboBox_GroupName->currentText(); - for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { + for ( int i = 1; i <= ComboBox_GroupName->count(); i++ ) { QString aName = ComboBox_GroupName->itemText( i ); if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) idx = i; } - if ( idx > 0 && idx < myGroups.count() ) { + 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" ), diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index 3f369e790..d82ec9c1d 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -452,12 +452,12 @@ bool SMESHGUI_NodesDlg::ClickOnApply() int idx = 0; if( addToGroup ) { aGroupName = ComboBox_GroupName->currentText(); - for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) { + for ( int i = 1; i <= ComboBox_GroupName->count(); i++ ) { QString aName = ComboBox_GroupName->itemText( i ); if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) ) idx = i; } - if ( idx > 0 && idx < myGroups.count() ) { + 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" ),