From 163fb83e85432ff4b4c6db26b3219fc0a819529d Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 25 Oct 2005 10:09:35 +0000 Subject: [PATCH] PAL10385: CreateAndDisplayGO does not work properly when reopening a study --- src/GEOMGUI/GeometryGUI_Swig.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index 9c1ef575f..277f1e4b2 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -111,13 +111,20 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) CORBA::String_var aFatherIOR; SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM"); - aStudyBuilder->DefineComponentInstance(father, Geom); - father->ComponentIOR(aFatherIOR); + if (father->_is_nil()) + return; + if (!father->ComponentIOR(aFatherIOR)) { + aStudyBuilder->LoadWith(father, Geom); + father->ComponentIOR(aFatherIOR); + } SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(ActiveStudy->getActiveStudyFrame()->entry()); SALOMEDS::SObject_var obj = aStudy->FindObjectID(myEntry.c_str()); + if (obj->_is_nil()) + return; + SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeIOR_var anIOR; // Create new actor @@ -129,7 +136,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue); TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape); - if (!obj->_is_nil()) { + if (!Shape.IsNull()) { if (obj->FindAttribute(anAttr, "AttributeName")) { SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); CORBA::String_var aNameValue = aName->Value(); -- 2.39.2