Salome HOME
bos #29484 Add a test service to build tesselation on a shape
[modules/geom.git] / src / GEOM_I / GEOM_DumpPython.cc
old mode 100755 (executable)
new mode 100644 (file)
index a9e00e5..754e170
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -83,12 +83,11 @@ void ConvertV6toV7( TCollection_AsciiString& theScript )
 //purpose  : 
 //=======================================================================
 
-Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, 
-                                        CORBA::Boolean isPublished, 
-                                        CORBA::Boolean isMultiFile,
+Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Boolean isPublished,
+                                         CORBA::Boolean isMultiFile,
                                          CORBA::Boolean& isValidScript)
 {
-  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
+  SALOMEDS::Study_var aStudy = getStudyServant();
   if(CORBA::is_nil(aStudy))
     return new Engines::TMPFile(0);   
 
@@ -134,10 +133,10 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
          anAttrStr = SALOMEDS::AttributeString::_narrow(anAttr);
          SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(anAttrStr->Value());
          ObjectStates* aStates = new ObjectStates();
-         for(int i = 0; i < aSections->length(); i++) {
+         for( CORBA::ULong i = 0; i < aSections->length(); i++) {
            TState aState;
            SALOMEDS::ListOfStrings aListOfVars = aSections[i];
-           for(int j = 0; j < aListOfVars.length(); j++) {
+           for( CORBA::ULong j = 0; j < aListOfVars.length(); j++) {
              bool isVar = aStudy->IsVariable(aListOfVars[j].in());
              TVariable aVar = TVariable( (char*)aListOfVars[j].in(), isVar );
              aState.push_back(aVar);
@@ -151,7 +150,7 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
   }
   
   TCollection_AsciiString aScript;
-  aScript += _impl->DumpPython(aStudy->StudyId(), objectDataVec, aVariableMap, isPublished, isMultiFile, isValidScript);
+  aScript += _impl->DumpPython(objectDataVec, aVariableMap, isPublished, isMultiFile, isValidScript);
 
   if (isPublished)
   {
@@ -282,7 +281,7 @@ char* GEOM_Gen_i::GetDumpName (const char* theStudyEntry)
 {
   const char* name = _impl->GetDumpName( theStudyEntry );
   if ( name && strlen( name ) > 0 )
-    return strdup( name );
+    return CORBA::string_dup( name );
 
   return NULL;
 }