X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDocument.cxx;h=a8b156974a0786e52f97150d9a9203145f60102b;hb=5bf7c51796867388334836847a6874640bc83f89;hp=9f18127593178c59252d1b171093dea920e64d03;hpb=1d69b92978803204089d270599133917d944c651;p=gdcm.git diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 9f181275..a8b15697 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2004/10/12 04:35:45 $ - Version: $Revision: 1.103 $ + Date: $Date: 2004/10/20 14:30:40 $ + Version: $Revision: 1.106 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1109,7 +1109,12 @@ void* Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem) dbg.Verbose(1, "Document::GetDocEntryByNumber: no entry"); return 0; } - return ((BinEntry *)entry)->GetBinArea(); + if ( BinEntry* binEntry = dynamic_cast(entry) ) + { + return binEntry->GetBinArea(); + } + + return 0; } /** @@ -1141,7 +1146,7 @@ void* Document::LoadEntryBinArea(uint16_t group, uint16_t elem) return NULL; } /// \todo Drop any already existing void area! JPR - if( !SetEntryBinAreaByNumber( a, group, elem ) ); + if( !SetEntryBinAreaByNumber( a, group, elem ) ) { dbg.Verbose(0, "Document::LoadEntryBinArea setting failed."); } @@ -2306,7 +2311,7 @@ bool Document::IsDocEntryAnInteger(DocEntry *entry) // encounter such an ill-formed image, we simply display a warning // message and proceed on parsing (while crossing fingers). std::ostringstream s; - int filePosition = ftell(Fp); + long filePosition = ftell(Fp); s << "Erroneous Group Length element length on : (" \ << std::hex << group << " , " << element << ") -before- position x(" << filePosition << ")" @@ -2447,6 +2452,8 @@ void Document::Initialise() { RefPubDict = Global::GetDicts()->GetDefaultPubDict(); RefShaDict = NULL; + RLEInfo = new RLEFramesInfo; + JPEGInfo = new JPEGFragmentsInfo; } /** @@ -2962,7 +2969,7 @@ void Document::ComputeRLEInfo() newFrameInfo->Offset[uk] = frameOffset + rleSegmentOffsetTable[uk]; newFrameInfo->Length[uk] = rleSegmentLength[uk]; } - RLEInfo.Frames.push_back( newFrameInfo ); + RLEInfo->Frames.push_back( newFrameInfo ); } // Make sure that at the end of the item we encounter a 'Sequence @@ -3001,7 +3008,7 @@ void Document::ComputeJPEGFragmentInfo() JPEGFragment* newFragment = new JPEGFragment; newFragment->Offset = fragmentOffset; newFragment->Length = fragmentLength; - JPEGInfo.Fragments.push_back( newFragment ); + JPEGInfo->Fragments.push_back( newFragment ); SkipBytes( fragmentLength ); }