From 643a00634f598428c28828f423316022ede40558 Mon Sep 17 00:00:00 2001 From: srn Date: Mon, 6 Feb 2006 08:28:15 +0000 Subject: [PATCH] changed method restoreVisualState --- src/Session/Session_Session_i.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 6568e5479..1a9662eea 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -216,14 +216,22 @@ CORBA::Long SALOME_Session_i::GetActiveStudyId() bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint) { + class TEvent: public SALOME_Event { + int _savePoint; + public: + TEvent(int savePoint) { _savePoint = savePoint; } + virtual void Execute() { + SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy(); + if ( study ) { + study->restoreState(_savePoint); + } + } + }; + if(SUIT_Session::session() && SUIT_Session::session()->activeApplication() ) { SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy(); - if(!study) { - SUIT_Session::session()->activeApplication()->createEmptyStudy(); - study = SUIT_Session::session()->activeApplication()->activeStudy(); - } - if(!study) return false; - study->restoreState(theSavePoint); + if(!study) SUIT_Session::session()->activeApplication()->createEmptyStudy(); + ProcessVoidEvent( new TEvent(theSavePoint) ); return true; } -- 2.39.2