]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for a regression: create a point(0, 0), start line creation, select the point...
authornds <nds@opencascade.com>
Wed, 16 Sep 2015 13:01:04 +0000 (16:01 +0300)
committernds <nds@opencascade.com>
Wed, 16 Sep 2015 13:01:04 +0000 (16:01 +0300)
src/PartSet/PartSet_WidgetPoint2d.cpp

index 7e0b3cc059bc578bea7b3dfbced6d64b37d642fc..d94afa5a0dc5c10b0018a0e933bf2347e743a49b 100644 (file)
@@ -444,12 +444,12 @@ bool PartSet_WidgetPoint2D::isFeatureContainsPoint(const FeaturePtr& theFeature,
   std::list<AttributePtr> anAttributes =
                                 myFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
   std::list<AttributePtr>::iterator anIter = anAttributes.begin();
-  for(; anIter != anAttributes.end(); anIter++) {
+  for(; anIter != anAttributes.end() && !aPointIsFound; anIter++) {
     AttributePoint2DPtr aPoint2DAttribute =
       std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIter);
     if (aPoint2DAttribute == aWidgetAttribute)
       continue;
-    if (aPoint2DAttribute.get()) {
+    if (aPoint2DAttribute.get() && aPoint2DAttribute->isInitialized()) {
       aPointIsFound = aPoint2DAttribute->pnt()->isEqual(aPnt2d);
     }
   }