X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeRefAttr.cpp;h=402935bb29440d5fa18e02c98473354881bfac63;hb=88be48ed1ea478b9d9d6ac2d965092418ef4dae6;hp=034620126a2020a307538db37c3225f105d2dcf2;hpb=1c292b5bf95e18a6c8fbe407c532213e10c673c5;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeRefAttr.cpp b/src/Model/Model_AttributeRefAttr.cpp index 034620126..402935bb2 100644 --- a/src/Model/Model_AttributeRefAttr.cpp +++ b/src/Model/Model_AttributeRefAttr.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: ModelAPI_AttributeRefAttr.cxx -// Created: 2 Apr 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include "Model_AttributeRefAttr.h" #include "Model_Application.h" @@ -20,9 +34,10 @@ void Model_AttributeRefAttr::setAttr(std::shared_ptr theAttr std::shared_ptr aData = std::dynamic_pointer_cast( theAttr->owner()->data()); std::string anID = aData->id(theAttr); - if (myIsInitialized && object() == theAttr->owner() && myID->Get().IsEqual(anID.c_str())) + ObjectPtr anObj = object(); + if (myIsInitialized && anObj == theAttr->owner() && myID->Get().IsEqual(anID.c_str())) return; // nothing is changed - REMOVE_BACK_REF(theAttr->owner()); + REMOVE_BACK_REF(anObj); myRef->Set(aData->label().Father()); myID->Set(aData->id(theAttr).c_str()); ADD_BACK_REF(theAttr->owner());