]> Creatis software - gdcm.git/commitdiff
- Clean out the Entries if a Document is parsed more than once
authorjpr <jpr>
Wed, 6 Jul 2005 09:25:12 +0000 (09:25 +0000)
committerjpr <jpr>
Wed, 6 Jul 2005 09:25:12 +0000 (09:25 +0000)
- Uncomment (usefull) warning messages

src/gdcmDocument.cxx

index 1b87b714fcbec6fb98a5129495a00d339e1f480e..8027220eb8cff68d6983418b6139f96fdc7ddf15 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/06 08:42:33 $
-  Version:   $Revision: 1.257 $
+  Date:      $Date: 2005/07/06 09:25:12 $
+  Version:   $Revision: 1.258 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -106,16 +106,15 @@ Document::~Document ()
  */
 bool Document::Load( std::string const &fileName ) 
 {
-   // We should clean out anything that already exists.
-   // Check IsDocumentAlreadyLoaded to be sure.
    if ( IsDocumentAlreadyLoaded )
    {
       gdcmWarningMacro( "A file was already parsed inside this "
                         << "gdcm::Document (previous name was: "
                         << Filename.c_str() << ". New name is :"
                         << fileName );
-     // todo : clean out the 'Document'
-     // Should we call ClearEntry() on the parent object ?!?
+     // clean out the Entries, if already parsed
+     // (probabely a mistake from the user)
+     ClearEntry();
    }
 
    Filename = fileName;
@@ -924,8 +923,8 @@ void Document::ParseDES(DocEntrySet *set, long offset,
             LoadDocEntry( newBinEntry );
             if ( !set->AddEntry( newBinEntry ) )
             {
-               //gdcmWarningMacro( "in ParseDES : cannot add a BinEntry "
-               //                    << newBinEntry->GetKey() );
+               gdcmWarningMacro( "in ParseDES : cannot add a BinEntry "
+                                   << newBinEntry->GetKey() );
                used=false;
             }
          }
@@ -974,8 +973,8 @@ void Document::ParseDES(DocEntrySet *set, long offset,
 
             if ( !set->AddEntry( newValEntry ) )
             {
-              //gdcmWarningMacro( "in ParseDES : cannot add a ValEntry "
-              //                    << newValEntry->GetKey() );  
+              gdcmWarningMacro( "in ParseDES : cannot add a ValEntry "
+                                  << newValEntry->GetKey() );  
               used=false;
             }
 
@@ -1063,8 +1062,8 @@ void Document::ParseDES(DocEntrySet *set, long offset,
          }
          if ( !set->AddEntry( newSeqEntry ) )
          {
-            //gdcmWarningMacro( "in ParseDES : cannot add a SeqEntry "
-            //                    << newSeqEntry->GetKey() );
+            gdcmWarningMacro( "in ParseDES : cannot add a SeqEntry "
+                                << newSeqEntry->GetKey() );
             used = false;
          }