From f3270a3761daadb51584995ec6db9c68072cf268 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 14 Oct 2019 16:40:18 +0300 Subject: [PATCH] Fix for '#17253 [CEA 17251] Fields: expand time series item' issue --- src/MEDCalc/gui/DatasourceController.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/MEDCalc/gui/DatasourceController.cxx b/src/MEDCalc/gui/DatasourceController.cxx index 04beddd78..68957f57a 100644 --- a/src/MEDCalc/gui/DatasourceController.cxx +++ b/src/MEDCalc/gui/DatasourceController.cxx @@ -220,6 +220,17 @@ void DatasourceController::OnAddImagesource() void DatasourceController::OnExpandField() { + SALOMEDS::Study_var aStudy = KERNEL::getStudyServant(); + // check if reference to study is valid + if (CORBA::is_nil(aStudy)) + return; + + // check if reference to use case builder is valid + SALOMEDS::UseCaseBuilder_var useCaseBuilder = aStudy->GetUseCaseBuilder(); + if (CORBA::is_nil(useCaseBuilder)) + return; + + // Get the selected objects in the study (SObject) SALOME_StudyEditor::SObjectList* listOfSObject = _studyEditor->getSelectedObjects(); for (int i=0; isize(); i++) { @@ -259,6 +270,7 @@ void DatasourceController::OnExpandField() _studyEditor->setName(soField,label.c_str()); _studyEditor->setParameterInt(soField, FIELD_ID, fieldHandler.id); _studyEditor->setParameterBool(soField,IS_IN_WORKSPACE,false); + useCaseBuilder->AppendTo(soField->GetFather(), soField); } } _salomeModule->updateObjBrowser(true); -- 2.39.2