From: vsr Date: Mon, 2 Apr 2018 13:58:30 +0000 (+0300) Subject: Merge branch 'V8_4_BR' X-Git-Tag: V8_5_0b1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=88141f757b048eaa5aae0be49faaf274448bbcaf;hp=f0f67c0b47e58361bc50c7169734da604fbfca01 Merge branch 'V8_4_BR' --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 62582e014..d3d701490 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1856,20 +1856,24 @@ void SMESHGUI::OnEditDelete() int objectCount = 0; QString aNameList; QString aParentComponent = QString::null; - Handle(SALOME_InteractiveObject) anIO; + for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() ) { - anIO = anIt.Value(); - QString cur = anIO->getComponentDataType(); - _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry()); + Handle(SALOME_InteractiveObject) anIO = anIt.Value(); + if ( anIO.IsNull() ) continue; + + QString father = "unknown"; + + _PTR(SObject) aSO = aStudy->FindObjectID( anIO->getEntry() ); if (aSO) { + father = QString::fromStdString( aSO->GetFatherComponent()->ComponentDataType() ); // check if object is reference _PTR(SObject) aRefSObj; aNameList.append("\n - "); if ( aSO->ReferencedObject( aRefSObj ) ) { QString aRefName = QString::fromStdString ( aRefSObj->GetName() ); aNameList.append( aRefName ); - cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() ); + father = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() ); } else aNameList.append(anIO->getName()); @@ -1877,8 +1881,8 @@ void SMESHGUI::OnEditDelete() } if( aParentComponent.isNull() ) - aParentComponent = cur; - else if( !aParentComponent.isEmpty() && aParentComponent!=cur ) + aParentComponent = father; + else if( !aParentComponent.isEmpty() && aParentComponent!=father ) aParentComponent = ""; }