Bug fixes for Body feature insert/remove functionality

This commit is contained in:
jrheinlaender
2013-04-11 19:46:53 +04:30
committed by Stefan Tröger
parent 3e4986f163
commit ee47c53339
7 changed files with 79 additions and 13 deletions

View File

@@ -257,16 +257,20 @@ void Body::removeFeature(App::DocumentObject* feature)
if (tipFeature == feature) {
// Set the Tip to the previous feature if possible, otherwise to the next feature
std::vector<App::DocumentObject*>::const_iterator prev = it, next = it;
prev--;
next++;
if (it != model.begin()) {
prev--;
next++;
if (prev != model.end()) {
Tip.setValue(*prev);
if (prev != model.end()) {
Tip.setValue(*prev);
} else {
if (next != model.end())
Tip.setValue(*next);
else
Tip.setValue(NULL);
}
} else {
if (next != model.end())
Tip.setValue(*next);
else
Tip.setValue(NULL);
Tip.setValue(NULL);
}
}