Fix GeoFeatureGroup claimChildren in case some out-of-group item links to a child
This commit is contained in:
@@ -2674,7 +2674,6 @@ void Document::_remObject(DocumentObject* pcObject)
|
||||
}
|
||||
signalDeletedObject(*pcObject);
|
||||
// TODO Check me if it's needed (2015-09-01, Fat-Zer)
|
||||
pcObject->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side
|
||||
|
||||
//remove the tip if needed
|
||||
if (Tip.getValue() == pcObject) {
|
||||
@@ -2695,6 +2694,7 @@ void Document::_remObject(DocumentObject* pcObject)
|
||||
}
|
||||
|
||||
// remove from map
|
||||
pcObject->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side
|
||||
d->objectMap.erase(pos);
|
||||
|
||||
for (std::vector<DocumentObject*>::iterator it = d->objectArray.begin(); it != d->objectArray.end(); ++it) {
|
||||
|
||||
@@ -1181,7 +1181,7 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh) {
|
||||
}
|
||||
|
||||
void DocumentItem::slotChangeObject(const Gui::ViewProviderDocumentObject& view)
|
||||
{
|
||||
{
|
||||
QString displayName = QString::fromUtf8(view.getObject()->Label.getValue());
|
||||
FOREACH_ITEM(item,view)
|
||||
item->setText(0, displayName);
|
||||
|
||||
@@ -80,12 +80,17 @@ std::vector<App::DocumentObject*> ViewProviderGeoFeatureGroupExtension::extensio
|
||||
|
||||
auto vin = obj->getInList();
|
||||
|
||||
//we don't want to count objects that are deleted
|
||||
vin.erase(std::remove_if(vin.begin(), vin.end(), [](App::DocumentObject* obj)->bool {
|
||||
return obj->isDeleting();
|
||||
//we don't want to count objects that are deleted or part of other geo feature groups.
|
||||
//Second criteria is actually not possible in normal operation, but only in some error
|
||||
//condition. But then it is needed to understand the problem for the user
|
||||
auto grp = getExtendedViewProvider()->getObject();
|
||||
vin.erase(std::remove_if(vin.begin(), vin.end(), [&](App::DocumentObject* obj)->bool {
|
||||
return obj->isDeleting() ||
|
||||
obj == grp ||
|
||||
App::GeoFeatureGroupExtension::getGroupOfObject(obj)!=grp;
|
||||
}), vin.end());
|
||||
|
||||
if(vin.size()<=1)
|
||||
if(vin.empty())
|
||||
claim.push_back(obj);
|
||||
}
|
||||
return claim;
|
||||
|
||||
Reference in New Issue
Block a user