From: jpr Date: Wed, 6 Jul 2005 15:18:42 +0000 (+0000) Subject: According to Mathieu's requirement, Load twice the same file keeps the rseult of X-Git-Tag: Version1.2.bp~355 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=779118e4b64c99707fc46fbecd840863a3eaf365;p=gdcm.git According to Mathieu's requirement, Load twice the same file keeps the rseult of the first Load (instead of doing it twice) --- diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 8027220e..b7bf7b52 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/07/06 09:25:12 $ - Version: $Revision: 1.258 $ + Date: $Date: 2005/07/06 15:18:42 $ + Version: $Revision: 1.259 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -108,13 +108,22 @@ bool Document::Load( std::string const &fileName ) { if ( IsDocumentAlreadyLoaded ) { + if ( Filename == fileName ) + { + gdcmWarningMacro( "The file was already parsed inside this " + << "gdcm::Document (its name is: " + << Filename.c_str() ); + return true; + } + gdcmWarningMacro( "A file was already parsed inside this " << "gdcm::Document (previous name was: " << Filename.c_str() << ". New name is :" << fileName ); // clean out the Entries, if already parsed // (probabely a mistake from the user) - ClearEntry(); + + ClearEntry(); } Filename = fileName;