From 3c0e51026707112189859e75ebf088f2d388d9e2 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 1 Nov 2019 11:45:11 +0300 Subject: [PATCH] Issue #2924: Disable Delete command for sub-shapes of comp-solids --- src/ModuleBase/ModuleBase_Tools.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index b8f595cb3..84d4809a1 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -407,13 +407,15 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe hasParameter |= (aConstruction.get() != NULL); if (hasFeature) hasCompositeOwner |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL); + else if (aResult.get()) + hasCompositeOwner |= (ModelAPI_Tools::bodyOwner(aResult) != NULL); if (!hasResultInHistory && aResult.get()) { FeaturePtr aFeature = ModelAPI_Feature::feature(aResult); hasResultInHistory = aFeature.get() && aFeature->isInHistory(); } - if (hasFeature && hasResult && hasParameter && hasCompositeOwner && hasFeature) + if (hasFeature && hasResult && hasParameter && hasCompositeOwner) break; } } -- 2.39.2