From e2dfbd98be639e517b92bc35a98b7659a406c2ff Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 13 Dec 2006 11:49:52 +0000 Subject: [PATCH] Modified method EnableUseCaseAutoFilling --- src/SALOMEDS/SALOMEDS_Study_i.cxx | 25 ++++++++++++++++++++++--- src/SALOMEDS/SALOMEDS_Study_i.hxx | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index dcf58e808..7110e933a 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -399,6 +399,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetFileNames(const char* theContext) //============================================================================ /*! Function : GetComponentNames * Purpose : method to get all components names + * SRN: Note, theContext can be any, it doesn't matter */ //============================================================================ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theContext) @@ -407,9 +408,6 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theCont SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; - if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) - throw SALOMEDS::Study::StudyInvalidContext(); - Handle(TColStd_HSequenceOfAsciiString) aSeq = _impl->GetComponentNames(TCollection_AsciiString((char*)theContext)); @@ -880,6 +878,27 @@ char* SALOMEDS_Study_i::GetDefaultScript(const char* theModuleName, const char* return CORBA::string_dup(script.c_str()); } +//============================================================================ +/*! Function : EnableUseCaseAutoFilling + * Purpose : + */ +//============================================================================ +void SALOMEDS_Study_i::EnableUseCaseAutoFilling(CORBA::Boolean isEnabled) +{ + _impl->EnableUseCaseAutoFilling(isEnabled); + Handle(SALOMEDSImpl_StudyBuilder) builder = _builder->GetImpl(); + if(!builder.IsNull()) { + if(isEnabled) { + builder->SetOnAddSObject(_impl->GetCallback()); + builder->SetOnRemoveSObject(_impl->GetCallback()); + } + else { + builder->SetOnAddSObject(NULL); + builder->SetOnRemoveSObject(NULL); + } + } +} + //=========================================================================== // PRIVATE FUNCTIONS //=========================================================================== diff --git a/src/SALOMEDS/SALOMEDS_Study_i.hxx b/src/SALOMEDS/SALOMEDS_Study_i.hxx index e1fdc8656..95d3b643d 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.hxx @@ -260,7 +260,7 @@ public: virtual void Close(); - void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled) { _impl->EnableUseCaseAutoFilling(isEnabled); } + void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled); // postponed destroying of CORBA object functionality virtual void AddPostponed(const char* theIOR); -- 2.39.2