From: nds Date: Wed, 24 Jan 2018 12:48:52 +0000 (+0300) Subject: Issue #2422 Filling: selection with Shift clears selection attribute X-Git-Tag: V_3.0.0RC1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=446bad817355268fb1910e723b30064ab02f319c;p=modules%2Fshaper.git Issue #2422 Filling: selection with Shift clears selection attribute --- diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 6336f5f3e..2edc3bc50 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -929,12 +929,6 @@ bool ModuleBase_WidgetMultiSelector::findInSelection(const ObjectPtr& theObject, return true; bool aFound = false; - if (theShape.get()) { // treat shape equal to context as null: 2219, keep order of shapes in list - const ResultPtr aContext = std::dynamic_pointer_cast(theObject); - if (aContext.get() && aContext->shape()->isEqual(theShape)) - theShape.reset(); - } - GeomShapePtr anEmptyShape(new GeomAPI_Shape()); GeomShapePtr aShape = theShape.get() ? theShape : anEmptyShape; if (theGeomSelection.find(theObject) != theGeomSelection.end()) {// found @@ -943,7 +937,16 @@ bool ModuleBase_WidgetMultiSelector::findInSelection(const ObjectPtr& theObject, for (; anIt != aLast && !aFound; anIt++) { GeomShapePtr aCShape = *anIt; if (aCShape.get()) + { + // treat shape equal to context as null: 2219, keep order of shapes in list + if (aCShape->isNull()) { // in selection, shape of result is equal to selected shape + // if so, here we need to check shape of result + ResultPtr aResult = std::dynamic_pointer_cast(theObject); + if (aResult.get()) + aCShape = aResult->shape(); + } aFound = aCShape->isSame(aShape); + } } }