From f8f26cfa9b40fcd528f7e032cc0e37cd3aa43086 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 30 Mar 2018 17:14:08 +0300 Subject: [PATCH] 0023538: EDF 16777 - ASTERSTUDY: Suppression of meshes when AsterStudy is activated --- src/SMESHGUI/SMESHGUI.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 526b6c650..5c2c18a7c 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1830,20 +1830,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()); @@ -1851,8 +1855,8 @@ void SMESHGUI::OnEditDelete() } if( aParentComponent.isNull() ) - aParentComponent = cur; - else if( !aParentComponent.isEmpty() && aParentComponent!=cur ) + aParentComponent = father; + else if( !aParentComponent.isEmpty() && aParentComponent!=father ) aParentComponent = ""; }