Salome HOME
updated copyright message
[modules/kernel.git] / src / DF / DF_Attribute.cxx
index c392dd9d201d41676d7ad9b23241998e0a1e5e77..d0df4dbc68b3cd42153a7f5d157c01dfee7d758c 100644 (file)
@@ -1,9 +1,26 @@
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
+//
+// 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 "DF_definitions.hxx"
 #include "DF_Label.hxx"
 #include "DF_Attribute.hxx"
 
-using namespace std;
-
 //Class DF_Attribute is used to store some data defined by the DF_Attribute type
 
 //Constructor
@@ -17,11 +34,12 @@ DF_Attribute::~DF_Attribute()
   //Remove an attribute from a map of the node's attributes to 
   //avoid double deletion on the node destruction
   if(_node) {
-    map<string, DF_Attribute*>::iterator mi;
+         std::map<std::string, DF_Attribute*>::iterator mi;
     for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) {
        if(mi->second == this) {
-        _node->_attributes.erase(mi);
-       }        
+         _node->_attributes.erase(mi);
+         return;
+       } 
     }
   }
 }
@@ -33,7 +51,7 @@ DF_Label DF_Attribute::Label() const
 }
 
  //Searches an Attribute with given ID located on the same Label as this Attribute.
-DF_Attribute* DF_Attribute::FindAttribute(const string& theID) const
+DF_Attribute* DF_Attribute::FindAttribute(const std::string& theID) const
 {
   if(!_node) return NULL;
   return Label().FindAttribute(theID);