From: ana Date: Mon, 20 Feb 2012 14:25:20 +0000 (+0000) Subject: Fix for the bug IPAL22857: "Find element by point problems" X-Git-Tag: V6_5_0a1~119 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4d706076ffe53bf258ba28122770117bd72a48c0;p=modules%2Fsmesh.git Fix for the bug IPAL22857: "Find element by point problems" --- diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx index 7e4fb9096..329a587e8 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx @@ -453,9 +453,6 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone() if ( !myMeshIO.IsNull() && myMeshIO->hasEntry() ) oldMeshEntry = myMeshIO->getEntry(); - myDlg->myMeshName->setText(""); - myMeshIO.Nullify(); - try { SALOME_ListIO aList; selectionMgr()->selectedObjects(aList, SVTK_Viewer::Type()); @@ -464,13 +461,16 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone() Handle(SALOME_InteractiveObject) anIO = aList.First(); _PTR(SObject) pObj = studyDS()->FindObjectID(anIO->getEntry()); CORBA::Object_var anObj = SMESH::IObjectToObject( anIO ); - myMeshOrPart = SMESH::SMESH_IDSource::_narrow(anObj); - if ( pObj && !myMeshOrPart->_is_nil() ) + newMeshEntry = anIO->getEntry(); + SMESH::SMESH_IDSource_var aMeshOrPart = SMESH::SMESH_IDSource::_narrow(anObj); + if ( pObj && !aMeshOrPart->_is_nil() && oldMeshEntry != newMeshEntry ) { + myMeshOrPart = aMeshOrPart; + myMeshIO.Nullify(); myMeshIO = anIO; std::string name = pObj->GetName(); + myDlg->myMeshName->setText(""); myDlg->myMeshName->setText( QString( name.c_str() ).trimmed() ); - newMeshEntry = anIO->getEntry(); SMESH::array_of_ElementType_var types = myMeshOrPart->GetTypes(); myDlg->setTypes( types ); }