From: vsv Date: Mon, 10 Jun 2019 09:49:34 +0000 (+0300) Subject: Remove already installed filters from combo box for choice X-Git-Tag: VEDF2019Lot4~101^2~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=196f7067f7d3b9401a7f42505541fe986fc2b513;p=modules%2Fshaper.git Remove already installed filters from combo box for choice --- diff --git a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp index 44079aea4..4146656b0 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp @@ -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(myFeature); std::list aFilters = aFiltersFeature->filters(); std::list::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);