]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Remove already installed filters from combo box for choice
authorvsv <vsv@opencascade.com>
Mon, 10 Jun 2019 09:49:34 +0000 (12:49 +0300)
committervsv <vsv@opencascade.com>
Mon, 10 Jun 2019 09:49:34 +0000 (12:49 +0300)
src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp

index 44079aea40e1af052f6cfdf2518495b333b6f3ed..4146656b07756456258126ed25151a50c4540407 100644 (file)
@@ -576,13 +576,17 @@ bool ModuleBase_WidgetSelectionFilter::storeValueCustom()
 
 bool ModuleBase_WidgetSelectionFilter::restoreValueCustom()
 {
+  ModelAPI_FiltersFactory* aFactory = ModelAPI_Session::get()->filters();
   FiltersFeaturePtr aFiltersFeature = std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(myFeature);
   std::list<std::string> aFilters = aFiltersFeature->filters();
   std::list<std::string>::const_iterator aIt;
   for (aIt = aFilters.cbegin(); aIt != aFilters.cend(); aIt++) {
     std::string aStr = (*aIt);
     onAddFilter(aStr);
-    myFiltersCombo->removeItem(myFiltersCombo->findText(aStr.c_str()));
+    FilterPtr aFilterObj = aFactory->filter(aStr);
+    int aId = myFiltersCombo->findText(aFilterObj->name().c_str());
+    if (aId != -1)
+      myFiltersCombo->removeItem(aId);
   }
   // Init filters member of the parent attribute
   AttributeSelectionListPtr aAttrList = mySelectorFeature->selectionList(mySelectorAttribute);