From: eap Date: Thu, 24 Nov 2011 10:50:53 +0000 (+0000) Subject: fix loadInMEDFileDS() to stop reading XDR file at ENREGISTREMENT DE TYPE 5 X-Git-Tag: V6_4_0^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FV6_4_0_BR;p=tools%2Fmedcoupling.git fix loadInMEDFileDS() to stop reading XDR file at ENREGISTREMENT DE TYPE 5 --- diff --git a/src/MEDLoader/SauvReader.cxx b/src/MEDLoader/SauvReader.cxx index f9e150a43..c3f41d87d 100644 --- a/src/MEDLoader/SauvReader.cxx +++ b/src/MEDLoader/SauvReader.cxx @@ -125,23 +125,17 @@ ParaMEDMEM::MEDFileData * SauvReader::loadInMEDFileDS() throw(INTERP_KERNEL::Exc recordNumber = getInt(); // read the record - switch ( recordNumber ) - { - case 2: - readRecord2(); - break; - case 4: - readRecord4(); - break; - case 7: - readRecord7(); - break; - case 5: - break; - default: - if ( !isASCII() ) - THROW_IK_EXCEPTION("XDR : ENREGISTREMENT DE TYPE " << recordNumber << " not implemented!!!"); - } + if ( recordNumber == 2 ) + readRecord2(); + else if (recordNumber == 4 ) + readRecord4(); + else if (recordNumber == 7 ) + readRecord7(); + else if (recordNumber == 5 ) + break; // stop reading + else + if ( !isASCII() ) + THROW_IK_EXCEPTION("XDR : ENREGISTREMENT DE TYPE " << recordNumber << " not implemented!!!"); } ParaMEDMEM::MEDFileData* medFileData = iMed.convertInMEDFileDS(); @@ -245,9 +239,10 @@ int SauvReader::readPileNumber(int& nbNamedObjects, int& nbObjects) THROW_IK_EXCEPTION("Invalid nb of named objects: " << nbNamedObjects << lineNb() ); if ( nbObjects<0) THROW_IK_EXCEPTION("Invalid nb of objects: " << nbObjects << lineNb() ); - if ( nbObjects_nbNodes*(_iMed->_spaceDim+1)) ) - THROW_IK_EXCEPTION("Erroor of reading PILE NUMERO " << PILE_COORDONNEES << lineNb() ); + THROW_IK_EXCEPTION("Error of reading PILE NUMERO " << PILE_COORDONNEES << lineNb() ); // there are coordinates + density for each node _iMed->_coords.resize( nbReals - nbReals/(_iMed->_spaceDim+1));