X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDWrapper%2FMED_Factory.cxx;h=9baac5aa081282882fa104a232c8552ff69fedae;hb=120207d740662965e1ca6dfe8325d1e7edad0e73;hp=278838a0c3b89e9933b22496820f56b34e6ac007;hpb=29fa6f3696b1a72716948c6e97a260cda288f6d0;p=modules%2Fsmesh.git diff --git a/src/MEDWrapper/MED_Factory.cxx b/src/MEDWrapper/MED_Factory.cxx index 278838a0c..9baac5aa0 100644 --- a/src/MEDWrapper/MED_Factory.cxx +++ b/src/MEDWrapper/MED_Factory.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -183,10 +183,10 @@ namespace MED if (!CheckCompatibility(fileName)) { EXCEPTION(std::runtime_error, "Cannot open file '"< 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); + return new MED::TWrapper(fileName, true, tfileInst, wantedMajor, wantedMinor); } }