From 51b74e342d4707e17538f1a00865c706e952af1f Mon Sep 17 00:00:00 2001 From: asl Date: Sat, 21 Nov 2009 12:10:42 +0000 Subject: [PATCH] dump notebook to python --- src/SALOMEDS/SALOMEDS_Driver_i.cxx | 15 +++++++++++---- src/SALOMEDS/SALOMEDS_Driver_i.hxx | 3 --- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.cxx b/src/SALOMEDS/SALOMEDS_Driver_i.cxx index f41cfc7a6..0aec6fc2d 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.cxx @@ -225,7 +225,17 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy SALOMEDS::unlock(); CORBA::Boolean aValidScript, aPublished = isPublished; - Engines::TMPFile_var aStream = aComponent->DumpPython(st.in(), aPublished, aValidScript); + Engines::TMPFile_var aStream; + if( CORBA::is_nil( aComponent ) ) + { + SALOME_NotebookDriver* aNbDriver = dynamic_cast + ( st_servant->_default_POA()->reference_to_servant( _driver ) ); + if( aNbDriver ) + aStream = aNbDriver->DumpPython( st._retn(), aValidScript ); + } + else + aStream = aComponent->DumpPython(st.in(), aPublished, aValidScript); + SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn()); theStreamLength = aTMPFile->Size(); isValidScript = aValidScript; @@ -242,9 +252,6 @@ SALOMEDS_DriverFactory_i::SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB) { _orb = CORBA::ORB::_duplicate(theORB); _name_service = new SALOME_NamingService(_orb); - - SALOME_NotebookDriver* aDriver = new SALOME_NotebookDriver(); - myNotebookDriver = aDriver->_this(); } SALOMEDS_DriverFactory_i::~SALOMEDS_DriverFactory_i() diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.hxx b/src/SALOMEDS/SALOMEDS_Driver_i.hxx index 09f69c398..8ead21ccb 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.hxx @@ -133,9 +133,6 @@ public: virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType); virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR); - -private: - SALOMEDS::Driver_var myNotebookDriver; }; #endif -- 2.39.2