- else {
- // keep only the name of the current part
- if (thePartsAttr->size() == 0) {
- FeaturePtr aPartFeature = ModelAPI_Tools::findPartFeature(aSession->moduleDocument(), aDoc);
-
- thePartsAttr->setSize(1);
- thePartsAttr->setValue(0, Locale::Convert::toString(aPartFeature->name()));
- theTargetAttr->setValue(0);
- }
+
+ if ((size_t)aPartsAttr->size() != anAcceptedValues.size())
+ aTargetAttr->setValue(0);
+
+ aPartsAttr->setSize((int)anAcceptedValues.size());
+ std::list<std::wstring>::iterator anIt = anAcceptedValues.begin();
+ for (int anInd = 0; anIt != anAcceptedValues.end(); ++anIt, ++anInd)
+ aPartsAttr->setValue(anInd, Locale::Convert::toString(*anIt));
+ }
+ else {
+ // keep only the name of the current part
+ if (aPartsAttr->size() == 0) {
+ FeaturePtr aPartFeature = ModelAPI_Tools::findPartFeature(aSession->moduleDocument(), aDoc);
+
+ aPartsAttr->setSize(1);
+ aPartsAttr->setValue(0, Locale::Convert::toString(aPartFeature->name()));
+ aTargetAttr->setValue(0);