- boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
- boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
- boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(attributeID()));
-
- FeaturePtr aFeature = aRef->feature();
- setFeature(aFeature);
- myAttribute = aRef->attr();
-
- std::string aText = "";
- if (aFeature)
- aText = aFeature->data()->getName().c_str();
- else if (myAttribute)
- aText = myAttribute->attributeType().c_str();
-
- editor()->setText(aText.c_str());
- return true;
+ boost::shared_ptr<ModelAPI_Data> aData = myFeature->data();
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef = boost::dynamic_pointer_cast<
+ ModelAPI_AttributeRefAttr>(aData->attribute(attributeID()));
+
+ ObjectPtr aObj = aRef->object();
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object());
+ if (aFeature) {
+ myObject = aFeature;
+ myAttribute = aRef->attr();
+
+ std::string aText = "";
+ if (aFeature)
+ aText = aFeature->data()->name().c_str();
+ if (myAttribute)
+ aText = myAttribute->attributeType().c_str();
+
+ editor()->setText(aText.c_str());
+ return true;
+ }
+ return false;