Salome HOME
Fix bug in test on 24 cores CPU test
[modules/kernel.git] / src / DF / DF_Document.cxx
index 5840bc330439a657f2336a906f7fa590b6c2d7dd..0cd2702c038b968964093e7516d4bcd2497f9005 100644 (file)
@@ -1,39 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "DF_definitions.hxx"
 #include "DF_Document.hxx"
 #include "DF_Label.hxx"
 #include "DF_ChildIterator.hxx"
 
-using namespace std;
-
 //Class DF_Document is container for user's data stored as a tree of Labels
 //with assigned Attributes
 
-DF_Document::DF_Document(const string& theDocumentType)
+DF_Document::DF_Document(const std::string& theDocumentType)
 {
   _id = -1;
   _type = theDocumentType;
-  _modified = true;
+  _modified = false;
 }
 
 DF_Document::~DF_Document()
@@ -82,7 +78,7 @@ int DF_Document::GetDocumentID() const
 }
 
 //Returns a type of the Document
-string DF_Document::GetDocumentType()
+std::string DF_Document::GetDocumentType()
 {
   return _type;
 }
@@ -92,17 +88,18 @@ void DF_Document::Clear()
 {
   if(_root.IsNull()) return;
 
-  vector<DF_LabelNode*> vn;
+  std::vector<DF_LabelNode*> vn;
   DF_ChildIterator CI(_root, true);
   for(; CI.More(); CI.Next()) {
     DF_LabelNode* node =  CI.Value()._node; 
     if(node) vn.push_back(node);
   }
 
-  for(int i = 0, len = vn.size(); i<len; i++)
+  for(size_t i = 0, len = vn.size(); i<len; i++)
     delete vn[i];
 
   _root._node->Reset();
+  _root.Nullify();
 }
 
 //Returns true if this document is empty
@@ -133,13 +130,13 @@ void DF_Document::SetModified(bool isModified)
 
 
 //Restores a content of the Document from the std::string theData
-void DF_Document::Load(const std::string& theData)
+void DF_Document::Load(const std::string& /*theData*/)
 {
    //Not implemented
 }
 
 //Converts a content of the Document into the std::string
-string DF_Document::Save()
+std::string DF_Document::Save()
 {
    //Not implemented
    return "";