From d6c65b31c8d79fedfe23dbdf62609d914808e07c Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 1 Feb 2018 11:19:22 +0300 Subject: [PATCH] Issue #2429 Regression : the preselection of a sketch is not taken into account --- src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 2edc3bc50..b1bb3b048 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -929,8 +929,13 @@ bool ModuleBase_WidgetMultiSelector::findInSelection(const ObjectPtr& theObject, return true; bool aFound = false; - GeomShapePtr anEmptyShape(new GeomAPI_Shape()); - GeomShapePtr aShape = theShape.get() ? theShape : anEmptyShape; + GeomShapePtr aShape = theShape; + if (!aShape.get()) { + // #2429 (the preselection of a sketch is not taken into account) + ResultPtr aResult = std::dynamic_pointer_cast(theObject); + if (aResult.get()) + aShape = aResult->shape(); + } if (theGeomSelection.find(theObject) != theGeomSelection.end()) {// found const std::set& aShapes = theGeomSelection.at(theObject); std::set::const_iterator anIt = aShapes.begin(), aLast = aShapes.end(); -- 2.39.2