From e63463c95428ad162e5780625851ccd3d752ae70 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 20 Nov 2009 10:40:51 +0000 Subject: [PATCH] new version of notebook() method --- src/SalomeApp/SalomeApp_Study.cxx | 15 ++++++++++----- src/SalomeApp/SalomeApp_Study.h | 3 ++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 25c266986..ed23c52ec 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -85,12 +85,17 @@ _PTR(Study) SalomeApp_Study::studyDS() const */ SALOME::Notebook_ptr SalomeApp_Study::notebook() const { - SALOME::Notebook_var aRes; - SALOMEDS_Study* aStudy = dynamic_cast( myStudyDS.operator->() ); - if( aStudy ) - aRes = aStudy->GetStudy()->GetNotebook(); + if( CORBA::is_nil( myNotebook ) ) + { + SALOME::Notebook_var aRes; + SALOMEDS_Study* aStudy = dynamic_cast( myStudyDS.operator->() ); + if( aStudy ) + aRes = aStudy->GetStudy()->GetNotebook(); + + const_cast( this )->myNotebook = aRes._retn(); + } - return aRes._retn(); + return myNotebook; } /*! diff --git a/src/SalomeApp/SalomeApp_Study.h b/src/SalomeApp/SalomeApp_Study.h index b9638c50d..a8d5b900b 100644 --- a/src/SalomeApp/SalomeApp_Study.h +++ b/src/SalomeApp/SalomeApp_Study.h @@ -104,7 +104,8 @@ private: QString newStudyName() const; private: - _PTR(Study) myStudyDS; + _PTR(Study) myStudyDS; + SALOME::Notebook_ptr myNotebook; }; #ifdef WIN32 -- 2.39.2