Fix wrong detection of multiple GeoFeatureGroups

This commit is contained in:
Stefan Tröger
2017-09-16 08:36:26 +02:00
committed by wmayer
parent f1c307dc28
commit 1248ba3bf9

View File

@@ -198,10 +198,11 @@ void GeoFeatureGroupExtension::extensionOnChanged(const Property* p) {
//would return anyone of it and hence it is possible that we miss an error. We need a custom check
auto list = obj->getInList();
for (auto in : list) {
if(in->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId()) &&
in != getExtendedObject()) {
error = true;
corrected.erase(std::remove(corrected.begin(), corrected.end(), obj), corrected.end());
if(in->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId()) && //is GeoFeatureGroup?
in != getExtendedObject() && //is a different one?
in->getExtensionByType<App::GeoFeatureGroupExtension>()->hasObject(obj)) { //is not a non-grouping link?
error = true;
corrected.erase(std::remove(corrected.begin(), corrected.end(), obj), corrected.end());
}
}
}