Salome HOME
0023505: Sigsegv with fuse on cylinder and cone
[modules/geom.git] / src / GEOM / GEOM_Function.cxx
index 1dee1d7657bfc24930c1a6dee98e11b862811115..92b3ff769205b23882c46b9839e00772e606c04a 100644 (file)
@@ -27,8 +27,6 @@
 #include <GEOM_Solver.hxx>
 #include <GEOM_ISubShape.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
 #include "utilities.h"
 
 #include <TDF.hxx>
 
 #include <TColStd_ListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_HArray1OfReal.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
-#include <TColStd_HSequenceOfTransient.hxx>
-#include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
 
 #include <cstdlib>
@@ -254,9 +248,8 @@ TopoDS_Shape GEOM_Function::GetValue()
           return aShape;
         }
       }
-      catch (Standard_Failure) {
-        Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-        MESSAGE("GEOM_Function::GetValue Error: " << aFail->GetMessageString());
+      catch (Standard_Failure& aFail) {
+        MESSAGE("GEOM_Function::GetValue Error: " << aFail.GetMessageString());
         return aShape;
       }
     }
@@ -826,12 +819,7 @@ void GEOM_Function::AddSubShapeReference(Handle(GEOM_Function) theSubShape)
 
   TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
 
-  Handle(TDataStd_ExtStringList) aList;
-  if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
-    aList = new TDataStd_ExtStringList;
-    aSubShapesLabel.AddAttribute(aList);
-  }
-
+  Handle(TDataStd_ExtStringList) aList = TDataStd_ExtStringList::Set( aSubShapesLabel );
   TCollection_AsciiString anEntry;
   TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
   aList->Append(anEntry);
@@ -884,11 +872,7 @@ const TDataStd_ListOfExtendedString& GEOM_Function::GetSubShapeReferences()
 
   TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
 
-  Handle(TDataStd_ExtStringList) aList;
-  if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
-    aList = new TDataStd_ExtStringList;
-    aSubShapesLabel.AddAttribute(aList);
-  }
+  Handle(TDataStd_ExtStringList) aList = TDataStd_ExtStringList::Set( aSubShapesLabel );
 
   _isDone = true;
   return aList->List();
@@ -993,5 +977,4 @@ void* GEOM_Function::GetCallBackData()
   return reinterpret_cast<void*> ( address );
 }
 
-IMPLEMENT_STANDARD_HANDLE (GEOM_Function, Standard_Transient);
 IMPLEMENT_STANDARD_RTTIEXT(GEOM_Function, Standard_Transient );