From: nds Date: Wed, 16 Sep 2015 13:01:04 +0000 (+0300) Subject: Fix for a regression: create a point(0, 0), start line creation, select the point... X-Git-Tag: V_1.4.0~56 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=278a7bcfb9c70d518c2fb847b2cfc39dea5a3131;p=modules%2Fshaper.git Fix for a regression: create a point(0, 0), start line creation, select the point as the line start point. The control did not lost the focus, because the attribute default value is (0,0). Initialize flag of the attribute should be checked. --- diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 7e0b3cc05..d94afa5a0 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -444,12 +444,12 @@ bool PartSet_WidgetPoint2D::isFeatureContainsPoint(const FeaturePtr& theFeature, std::list anAttributes = myFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::iterator anIter = anAttributes.begin(); - for(; anIter != anAttributes.end(); anIter++) { + for(; anIter != anAttributes.end() && !aPointIsFound; anIter++) { AttributePoint2DPtr aPoint2DAttribute = std::dynamic_pointer_cast(*anIter); if (aPoint2DAttribute == aWidgetAttribute) continue; - if (aPoint2DAttribute.get()) { + if (aPoint2DAttribute.get() && aPoint2DAttribute->isInitialized()) { aPointIsFound = aPoint2DAttribute->pnt()->isEqual(aPnt2d); } }