From: nds Date: Thu, 1 Feb 2018 08:19:22 +0000 (+0300) Subject: Issue #2429 Regression : the preselection of a sketch is not taken into account X-Git-Tag: V_3.0.0~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d6c65b31c8d79fedfe23dbdf62609d914808e07c;p=modules%2Fshaper.git Issue #2429 Regression : the preselection of a sketch is not taken into account --- 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();