X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHEXABLOCKGUI%2FHEXABLOCKGUI_SalomeTools.cxx;h=1dae5ca782ea2dfdedc600aabb0c3e7088aaa9be;hb=12cceffda96f1daef01df1fb7024cf164bf31067;hp=a05e5dab184e1b1eaf833c1b0a0b6f6beeb32562;hpb=35425d54d37d72474a20dd10c2c827fed3caa5a3;p=modules%2Fhexablock.git diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx index a05e5da..1dae5ca 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2015 CEA/DEN, EDF R&D +// Copyright (C) 2009-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -28,11 +28,8 @@ #include #include -#include - #include -#include #include #include @@ -89,13 +86,12 @@ namespace GUI } - _PTR(Study) GetActiveStudyDocument() + _PTR(Study) getStudy() { - SalomeApp_Study* aStudy = dynamic_cast(GetActiveStudy()); - if (aStudy) - return aStudy->studyDS(); - else - return _PTR(Study)(); + static _PTR(Study) _study; + if(!_study) + _study = SalomeApp_Application::getStudy(); + return _study; } @@ -175,14 +171,10 @@ namespace GUI Handle(SelectMgr_Selection) sel = theObj->Selection( m ); for ( sel->Init(); sel->More(); sel->Next() ) { -#if OCC_VERSION_LARGE > 0x06080100 const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive(); if ( aHSenEntity.IsNull() ) continue; Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive(); -#else - Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive(); -#endif if ( entity.IsNull() ) continue;