From: dmv Date: Mon, 24 Aug 2009 11:31:32 +0000 (+0000) Subject: Editing hypothesis bug... X-Git-Tag: V5_1_3rc1~108 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=96777f9e35be4cf03ba1def7d68f6f41c9791c0f;p=modules%2Fsmesh.git Editing hypothesis bug... --- diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index b7a6b099d..796e3461a 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1071,9 +1071,11 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim, anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); if ( anObjEntry == "" ) { anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); - _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); - GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); - anObjEntry = ( aGeomVar->_is_nil() ) ? "" : anObjEntry = aGeomVar->GetStudyEntry(); + if ( anObjEntry != "" ) { + _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); + GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); + anObjEntry = ( aGeomVar->_is_nil() ) ? "" : anObjEntry = aGeomVar->GetStudyEntry(); + } } aCreator->setShapeEntry( anObjEntry ); @@ -1137,9 +1139,11 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex ) anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); if ( anObjEntry == "" ) { anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); - _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); - GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); - anObjEntry = aGeomVar->GetStudyEntry(); + if ( anObjEntry != "" ) { + _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); + GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); + anObjEntry = aGeomVar->GetStudyEntry(); + } } aCreator->setShapeEntry( anObjEntry );