From 446bad817355268fb1910e723b30064ab02f319c Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 24 Jan 2018 15:48:52 +0300 Subject: [PATCH] Issue #2422 Filling: selection with Shift clears selection attribute --- src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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); + } } } -- 2.39.2