Salome HOME
updated copyright message
[modules/smesh.git] / src / MEDWrapper / MED_Factory.cxx
index e8c145f8ca66f7bdae91658de313f04e1b855498..9baac5aa081282882fa104a232c8552ff69fedae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  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 '"<<fileName<<"'.");
     }
-    return new MED::TWrapper(fileName, false);
+    return new MED::TWrapper(fileName, false, nullptr);
   }
 
-  PWrapper CrWrapperW(const std::string& fileName, int theVersion)
+  PWrapper CrWrapperW(const std::string& fileName, int theVersion, TFileInternal *tfileInst)
   {
     bool isCreated = false;
     if (!CheckCompatibility(fileName, true))
@@ -197,13 +197,13 @@ namespace MED
     med_int wantedMajor = MED_MAJOR_NUM;
     med_int wantedMinor = MED_MINOR_NUM;
     // when non managed version of file is requested : ignore it and take the latest version
-    std::vector<int> versionsOK(GetMEDVersionsAppendCompatible());
-    bool isVersionRequestedOK(std::find(versionsOK.begin(),versionsOK.end(),theVersion)!=versionsOK.end());
+    std::vector<int> versionsOK = GetMEDVersionsAppendCompatible();
+    bool   isVersionRequestedOK = std::find(versionsOK.begin(),versionsOK.end(),theVersion)!=versionsOK.end();
     if (isCreated && isVersionRequestedOK)
     {
-      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);
   }
 }