From: jfa Date: Tue, 3 Oct 2023 14:25:44 +0000 (+0100) Subject: Fix an error X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fefe448915b42429158ae72cd23f7e95f48fced9;p=modules%2Fshaper.git Fix an error --- diff --git a/src/SketchPlugin/SketchPlugin_Offset.cpp b/src/SketchPlugin/SketchPlugin_Offset.cpp index a32d1e835..119a7373b 100644 --- a/src/SketchPlugin/SketchPlugin_Offset.cpp +++ b/src/SketchPlugin/SketchPlugin_Offset.cpp @@ -81,13 +81,12 @@ void SketchPlugin_Offset::initAttributes() data()->addAttribute(REVERSED_ID(), ModelAPI_AttributeBoolean::typeId()); // #3 // SketchPlugin_Constraint::ENTITY_A() stores original entities + AttributeRefListPtr entaAttr = std::dynamic_pointer_cast + (data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), + ModelAPI_AttributeRefList::typeId())); // #4 bool badOrder = false; if (anEdgesAttr->isInitialized()) { // restoring data from saved study - AttributeRefListPtr entaAttr = std::dynamic_pointer_cast - (data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), - ModelAPI_AttributeRefList::typeId())); // #4 - badOrder = !entaAttr->isInitialized(); // we have not found AttributeRefList at 4th position, // so, we suppose a study with wrong order of offset attributes @@ -104,9 +103,10 @@ void SketchPlugin_Offset::initAttributes() ModelAPI_AttributeBoolean::typeId(), 4)); // #4 - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), - ModelAPI_AttributeRefList::typeId(), - 5); // #5 + entaAttr = std::dynamic_pointer_cast + (data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), + ModelAPI_AttributeRefList::typeId(), + 5)); // #5 } // store offset entities