X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGuiHelpers%2FSALOME_AppStudyEditor.cxx;h=139f7ea4439d10606ce440b8bc99aa5b92321d8a;hb=5015bf4f1283a8ca5d6ab862f235322755cb7be9;hp=1cdb45fd86929a2b5ec84389cc4159ab83eed9d5;hpb=c4b058d18583af7f94042eb55d4b933dd222d2e6;p=modules%2Fgui.git diff --git a/src/GuiHelpers/SALOME_AppStudyEditor.cxx b/src/GuiHelpers/SALOME_AppStudyEditor.cxx index 1cdb45fd8..139f7ea44 100644 --- a/src/GuiHelpers/SALOME_AppStudyEditor.cxx +++ b/src/GuiHelpers/SALOME_AppStudyEditor.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ // Author: Guillaume Boulant (EDF/R&D) #include "SALOME_AppStudyEditor.hxx" +#include "SALOME_GuiServices.hxx" #include #include @@ -29,34 +30,12 @@ SALOME_AppStudyEditor::SALOME_AppStudyEditor(SalomeApp_Application * salomeApp) : SALOME_StudyEditor() { _salomeApp = salomeApp; - updateActiveStudy(); -} - -/** - * This updates the editor with the current active study. If the - * active study id is identical to the study id currently associated - * to this object, then no update is performed. - */ -int SALOME_AppStudyEditor::updateActiveStudy() { - int activeStudyId = SALOME_AppStudyEditor::getActiveStudyId(_salomeApp); - if ( activeStudyId != this->getStudyId() ) { - this->setStudyById(activeStudyId); - } - return activeStudyId; -} - -// GUI context only -int SALOME_AppStudyEditor::getActiveStudyId(SalomeApp_Application * salomeApp) { - SalomeApp_Study* appStudy = dynamic_cast (salomeApp->activeStudy()); - _PTR(Study) aCStudy = appStudy->studyDS(); - int studyId = aCStudy->StudyId(); - return studyId; } SALOMEDS::SObject_ptr SALOME_AppStudyEditor::IObjectToSObject(const Handle(SALOME_InteractiveObject)& iobject) { if (!iobject.IsNull()) { if (iobject->hasEntry()) { - SALOMEDS::SObject_var sobject = _study->FindObjectID(iobject->getEntry()); + SALOMEDS::SObject_var sobject = GUI::getStudyServant()->FindObjectID(iobject->getEntry()); return sobject._retn(); } }