+ if (aFeature.get()) {
+ if (aResult.get()) { // check result is in feature
+ if (aResult->document()->feature(aResult) == aFeature)
+ return false;
+ }
+ else { // check selection of the same features
+ if (aFeature == aSelectionAttribute->contextFeature())
+ return false;
+ }
+ }
+ else {
+ if (!aResult.get() && aResultContext.get()) {
+ FeaturePtr aSelectedFeature = aSelectionAttribute->contextFeature();
+ if (aResultContext->document()->feature(aResultContext) == aSelectedFeature)
+ return false;
+ }
+ }