From 81f91387c81ebb53f6d3e58a5a57463c528b7837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Thu, 9 Feb 2017 22:06:05 +0100 Subject: [PATCH] Fix collecting of cs relevant links --- src/App/GeoFeatureGroupExtension.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/App/GeoFeatureGroupExtension.cpp b/src/App/GeoFeatureGroupExtension.cpp index 5b52d822cb..8c9654492c 100644 --- a/src/App/GeoFeatureGroupExtension.cpp +++ b/src/App/GeoFeatureGroupExtension.cpp @@ -262,11 +262,23 @@ std::vector< DocumentObject* > GeoFeatureGroupExtension::getCSInList(DocumentObj std::vector< DocumentObject* > GeoFeatureGroupExtension::getCSRelevantLinks(DocumentObject* obj) { - auto vec1 = getCSInList(obj); - auto vec2 = getCSOutList(obj); + //we need to get the outlist of all inlist objects and ourself. This is needed to handle things + //like Booleans: the boolean is our parent, than there is a second object under it which relates + //to obj and needs to be handled. + auto in = getCSInList(obj); + in.push_back(obj); //there may be nothing in inlist + std::vector result; + for(auto o : in) { + + auto out = getCSOutList(o); + result.insert(result.end(), out.begin(), out.end()); + } - vec1.insert(vec1.end(), vec2.begin(), vec2.end()); - return vec1; + //there will be many douplicates + std::sort(result.begin(), result.end()); + result.erase(std::unique(result.begin(), result.end()), result.end()); + + return result; }