Salome HOME
Issue 0013373: EDF PAL 273 : Option Single/Multi file dump
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_Driver_i.cxx
index ed75abfc61a6151f1ff90ecfed64e99af2de0604..b5d0b241f47e31060c1928d5f1a51b8eb4729623 100644 (file)
@@ -18,7 +18,6 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
 
 #include "SALOMEDS_Driver_i.hxx"
 #include "SALOMEDS_TMPFile_i.hxx"
@@ -159,7 +158,7 @@ bool SALOMEDS_Driver_i::CanCopy(const SALOMEDSImpl_SObject& theObject)
 
   SALOMEDS::unlock();
   bool isOk = _driver->CanCopy(so.in());
-  so->Destroy();
+  so->UnRegister();
   SALOMEDS::lock();
 
   return isOk;
@@ -214,16 +213,17 @@ std::string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream,
 
 SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy, 
                                                     bool isPublished, 
+                                                    bool isMultiFile,
                                                     bool& isValidScript,
                                                     long& theStreamLength)
 {
-  SALOMEDS_Study_i *  st_servant = new SALOMEDS_Study_i (theStudy, _orb);
+  SALOMEDS_Study_i *  st_servant = SALOMEDS_Study_i::GetStudyServant(theStudy, _orb);//new SALOMEDS_Study_i (theStudy, _orb);
   SALOMEDS::Study_var st  = SALOMEDS::Study::_narrow(st_servant->_this());
-  Engines::Component_ptr aComponent = Engines::Component::_narrow(_driver);
+  Engines::EngineComponent_ptr aComponent = Engines::EngineComponent::_narrow(_driver);
 
   SALOMEDS::unlock();
   CORBA::Boolean aValidScript, aPublished = isPublished;
-  Engines::TMPFile_var aStream = aComponent->DumpPython(st.in(), aPublished, aValidScript);
+  Engines::TMPFile_var aStream = aComponent->DumpPython(st.in(), aPublished, isMultiFile, aValidScript);
   SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn());
   theStreamLength = aTMPFile->Size();
   isValidScript = aValidScript;