]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
new version of notebook() method
authorasl <asl@opencascade.com>
Fri, 20 Nov 2009 10:40:51 +0000 (10:40 +0000)
committerasl <asl@opencascade.com>
Fri, 20 Nov 2009 10:40:51 +0000 (10:40 +0000)
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/SalomeApp_Study.h

index 25c2669866526bd089584c9da6ba4930ebf24b77..ed23c52ec7e086555be82d61a53abf8045c625ca 100644 (file)
@@ -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<SALOMEDS_Study*>( myStudyDS.operator->() );
-  if( aStudy )
-    aRes = aStudy->GetStudy()->GetNotebook();
+  if( CORBA::is_nil( myNotebook ) )
+  {
+    SALOME::Notebook_var aRes;
+    SALOMEDS_Study* aStudy = dynamic_cast<SALOMEDS_Study*>( myStudyDS.operator->() );
+    if( aStudy )
+      aRes = aStudy->GetStudy()->GetNotebook();
+
+    const_cast<SalomeApp_Study*>( this )->myNotebook = aRes._retn();
+  }
 
-  return aRes._retn();
+  return myNotebook;
 }
 
 /*!
index b9638c50d05207df79f6cc0039efedd4082fb883..a8d5b900bf20a24e817ee5607ff69c32cb77bd0c 100644 (file)
@@ -104,7 +104,8 @@ private:
   QString             newStudyName() const;
 
 private:
-  _PTR(Study)         myStudyDS;
+  _PTR(Study)          myStudyDS;
+  SALOME::Notebook_ptr myNotebook;
 };
 
 #ifdef WIN32