Salome HOME
Fix compilation error due API modification (returned type) of ReadField
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Aug 2018 08:59:22 +0000 (10:59 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Aug 2018 08:59:22 +0000 (10:59 +0200)
src/MEDCalculator/MEDCalculatorBrowserField.cxx

index 1559c256177e5758b3aea74b2ec39f4d2bb2be85..e26b1d35909e3a5094cf2116abf3e3634f8b949e 100644 (file)
@@ -63,12 +63,16 @@ MEDCalculatorBrowserField::MEDCalculatorBrowserField(const char *fname, const ch
   MCAuto<MEDCouplingFieldDouble> tmpf;
   try
     {
-      tmpf=ReadField(_type,fname,meshNames[0].c_str(),0,fieldName,dtits[0].first.first,dtits[0].first.second);
+      MCAuto<MEDCouplingField> tmpf2(ReadField(_type,fname,meshNames[0].c_str(),0,fieldName,dtits[0].first.first,dtits[0].first.second));
+      tmpf=DynamicCast<MEDCouplingField,MEDCouplingFieldDouble>(tmpf2);
     }
   catch(INTERP_KERNEL::Exception& e)
     {
       if(_type==ON_CELLS)
-        tmpf=ReadField(_type,fname,meshNames[0].c_str(),-1,fieldName,dtits[0].first.first,dtits[0].first.second);
+        {
+          MCAuto<MEDCouplingField> tmpf2(ReadField(_type,fname,meshNames[0].c_str(),-1,fieldName,dtits[0].first.first,dtits[0].first.second));
+          tmpf=DynamicCast<MEDCouplingField,MEDCouplingFieldDouble>(tmpf2);
+        }
       else
         throw e;
     }