]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1037 : using of: implementation of cashing of values for method isInList
authornds <nds@opencascade.com>
Thu, 28 Apr 2016 12:15:03 +0000 (15:15 +0300)
committernds <nds@opencascade.com>
Thu, 28 Apr 2016 12:15:03 +0000 (15:15 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp

index 7a187e57c4e864cfd9cb40cbbaee319a30bd84a9..fa5d776753a9b714af58a64aa11a29eef526b400 100755 (executable)
@@ -220,6 +220,12 @@ bool ModuleBase_WidgetMultiSelector::restoreValueCustom()
 bool ModuleBase_WidgetMultiSelector::setSelection(QList<ModuleBase_ViewerPrsPtr>& theValues,
                                                   const bool theToValidate)
 {
+  AttributeSelectionListPtr aSelectionListAttr;
+  if (attribute()->attributeType() == ModelAPI_AttributeSelectionList::typeId())
+    aSelectionListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(attribute());
+  if (aSelectionListAttr.get())
+    aSelectionListAttr->cashValues(true);
+
   /// remove unused objects from the model attribute.
   /// It should be performed before new attributes append.
   removeUnusedAttributeObjects(theValues);
@@ -261,6 +267,9 @@ bool ModuleBase_WidgetMultiSelector::setSelection(QList<ModuleBase_ViewerPrsPtr>
     //emit valuesChanged();
   //}
 
+  if (aSelectionListAttr.get())
+    aSelectionListAttr->cashValues(false);
+
   theValues.clear();
   if (!anInvalidValues.empty())
     theValues.append(anInvalidValues);