]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Editing hypothesis bug...
authordmv <dmv@opencascade.com>
Mon, 24 Aug 2009 11:31:32 +0000 (11:31 +0000)
committerdmv <dmv@opencascade.com>
Mon, 24 Aug 2009 11:31:32 +0000 (11:31 +0000)
src/SMESHGUI/SMESHGUI_MeshOp.cxx

index b7a6b099d23d5b6eeb770ca61e985d64025b6f49..796e3461ac2c0cd1bc079ad004548c8556431d17 100644 (file)
@@ -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 );