}
if (aPartModel) {
QModelIndex aIndex = aPartModel->findGroup(aGroup);
- int aStart = aPartModel->rowCount(aIndex);
+ int aStart = aPartModel->rowCount(aIndex) - 1;
aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
removeRow(aStart, aIndex);
}
} else {
ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
aDoc = aObject->featureRef()->data()->docRef("PartDocument")->value();
+ aFeature = aObject->featureRef();
}
if (aDoc == aMgr->currentDocument()) {
aDoc->close();
}
- } //else
- //aDoc = aFeature->document();
+ } else {
+ if (!aFeature->data()) {
+ ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
+ aFeature = aObject->featureRef();
+ }
+ }
aMgr->rootDocument()->removeFeature(aFeature);
}
aMgr->rootDocument()->finishOperation();