X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmObject.cxx;h=d4527bc1449dc9e5f58601fb2adc29a91e4cf5b7;hb=0aefbe64c65acfed527a7f18b352a2621f4bc92b;hp=cef909778526d8736e2b2191156d384a8fb22e63;hpb=0e82725d64f17545e782c18039ced7ea898f8cad;p=gdcm.git diff --git a/src/gdcmObject.cxx b/src/gdcmObject.cxx index cef90977..d4527bc1 100644 --- a/src/gdcmObject.cxx +++ b/src/gdcmObject.cxx @@ -1,7 +1,7 @@ // gdcmObject.cxx //----------------------------------------------------------------------------- #include "gdcmObject.h" -#include "gdcmUtil.h" +#include "gdcmGlobal.h" #include "gdcmDebug.h" //----------------------------------------------------------------------------- @@ -47,7 +47,7 @@ void gdcmObject::Print(std::ostream &os) { for(i=beginObj;;++i) { (*i)->SetPrintLevel(printLevel); (*i)->Print(os); - if (i == endObj) break; + if (i == endObj) break; } } } @@ -92,19 +92,22 @@ std::string gdcmObject::GetEntryByName(TagName name) { * @param flag = 0 when META to be dealt with */ void gdcmObject::ResetBoundaries(int flag) { - + if (flag) { // it's NOT a META // upwards to fffe,e000 - for( i=j=debut(); - ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0x0000); - --i,j--) { - } + for( i=j=debut(); + ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0xe000); + --i,j--) { + } beginObj=j; } - // downwards to fffe,e000 + // upwards again to fffe,e000 + if (fin()== (--(plistEntries->end())) ) // Don't try anything more when end + return; // of Chained List is reached + for( i=j=fin(); - ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0x0000); + ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0xe000); --i,j--) { } j--;