From cf2eaff168cf517c8045c12a061cbe3fbca84e4c Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 1 Jun 2007 13:05:54 +0000 Subject: [PATCH] Fix for bug Bug IPAL16080 - IOLS. Impossible to display and edit presentations created in 3x --- src/VISU_I/VISU_GaussPoints_i.cc | 11 +++++++++++ src/VISU_I/VISU_ScalarMap_i.cc | 30 ++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index a9a19426..679dd5d7 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -259,6 +259,17 @@ VISU::GaussPoints_i if(!TSuperClass::Restore(theSObject, theMap)) return NULL; + // Check if the icon needs to be updated, update if necessary + SALOMEDS::Study_var aStudy = theSObject->GetStudy(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::GenericAttribute_var anAttr = + aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + + CORBA::String_var aPixMapName = aPixmap->GetPixMap(); + if(strcmp(GetIconName(), aPixMapName.in()) != 0) + aPixmap->SetPixMap(GetIconName()); + SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt()); SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt()); SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt()); diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 5d621843..58996e3f 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -256,17 +256,31 @@ VISU::ScalarMap_i UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt()); - QString aGeomNames = VISU::Storable::FindValue(theMap, "myGeomNameList"); - QStringList aGeomNameList = QStringList::split("|", aGeomNames); - int aNbOfGroups = aGeomNameList.count(); - if(aNbOfGroups > 0){ - RemoveAllGeom(); - for(int aGroupNum = 0; aGroupNum < aNbOfGroups; aGroupNum++){ - QString aGroupName = aGeomNameList[aGroupNum]; - AddMeshOnGroup(aGroupName.latin1()); + bool anIsExists; + QString aGeomNames = VISU::Storable::FindValue(theMap, "myGeomNameList", &anIsExists); + if(anIsExists){ + QStringList aGeomNameList = QStringList::split("|", aGeomNames); + int aNbOfGroups = aGeomNameList.count(); + if(aNbOfGroups > 0){ + RemoveAllGeom(); + for(int aGroupNum = 0; aGroupNum < aNbOfGroups; aGroupNum++){ + QString aGroupName = aGeomNameList[aGroupNum]; + AddMeshOnGroup(aGroupName.latin1()); + } } } + // Check if the icon needs to be updated, update if necessary + SALOMEDS::Study_var aStudy = theSObject->GetStudy(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::GenericAttribute_var anAttr = + aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + + CORBA::String_var aPixMapName = aPixmap->GetPixMap(); + if(strcmp(GetIconName(), aPixMapName.in()) != 0) + aPixmap->SetPixMap(GetIconName()); + return this; } -- 2.39.2