- /*
- list<ObjectPtr> aSubs = data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->list();
- list<ObjectPtr>::iterator aSubIt = aSubs.begin(), aLastIt = aSubs.end();
- bool isRemoved = false;
- bool aHasEmtpyFeature = false;
- for(; aSubIt != aLastIt && !isRemoved; aSubIt++) {
- std::shared_ptr<ModelAPI_Feature> aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*aSubIt);
- if (aFeature.get() != NULL && aFeature == theFeature) {
- data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->remove(aFeature);
- isRemoved = true;
+
+ std::map<int, std::shared_ptr<ModelAPI_Feature> >::iterator aSubIter = mySubs.begin();
+ for(; aSubIter != mySubs.end(); aSubIter++) {
+ if (aSubIter->second == theFeature) {
+ mySubs.erase(aSubIter);
+ break;