X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMBase%2FGEOMBase_Helper.cxx;h=e7b02e6b4e3779ab1c6ef61fdea586bad48f2b4b;hb=bae730c25a11e3cb47582fd92b2d9a39237dc84a;hp=32b06fef04eed3a9cc97c8f51d19da8b9a9df908;hpb=7d880c6a8262b6d670ed70ee2b9ec25c199a46d4;p=modules%2Fgeom.git diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 32b06fef0..e7b02e6b4 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -1123,7 +1123,6 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr int theIndex ) { GEOM::GEOM_Object_var object; - bool found = false; SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); if ( study ) { @@ -1132,16 +1131,15 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr _PTR(SObject) sobject( studyDS->FindObjectIOR( IOR.toLatin1().constData() ) ); if ( sobject ) { _PTR(ChildIterator) it( studyDS->NewChildIterator( sobject ) ); - for ( ; it->More() && !found; it->Next() ) { + for ( ; it->More(); it->Next() ) { GEOM::GEOM_Object_var cobject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( it->Value() ) ); if ( !CORBA::is_nil( cobject ) ) { GEOM::ListOfLong_var indices = cobject->GetSubShapeIndices(); int length = indices->length(); - for ( int i = 0; i < length && !found; i++ ) { - if ( indices[i] == theIndex ) { - object = cobject; - found = true; - } + // VSR 18/03/2014: we need only sub-shapes with single sub-shape index (to exclude groups, etc) + if ( length == 1 && indices[0] == theIndex ) { + object = cobject; + break; } } }