From: Anthony Geay Date: Mon, 6 Apr 2020 19:53:23 +0000 (+0200) Subject: CEA18933 : As before, when non managed version requested, ignore and take the latest X-Git-Tag: V9_5_0b1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a21c246418a97f7a8246e41c474ea526ceeeef41;p=modules%2Fsmesh.git CEA18933 : As before, when non managed version requested, ignore and take the latest --- diff --git a/src/MEDWrapper/MED_Factory.cxx b/src/MEDWrapper/MED_Factory.cxx index 278838a0c..af7285801 100644 --- a/src/MEDWrapper/MED_Factory.cxx +++ b/src/MEDWrapper/MED_Factory.cxx @@ -196,13 +196,13 @@ namespace MED } med_int wantedMajor = MED_MAJOR_NUM; med_int wantedMinor = MED_MINOR_NUM; - if (isCreated) + // when non managed version of file is requested : ignore it and take the latest version + std::vector versionsOK(GetMEDVersionsAppendCompatible()); + bool isVersionRequestedOK(std::find(versionsOK.begin(),versionsOK.end(),theVersion)!=versionsOK.end()); + if (isCreated && isVersionRequestedOK) { - if (theVersion > 0) - { - wantedMajor = theVersion/10; - wantedMinor = theVersion%10; - } + wantedMajor = theVersion/10; + wantedMinor = theVersion%10; } return new MED::TWrapper(fileName, true, wantedMajor, wantedMinor); }