mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 17:50:34 +05:00
Issue !16751: [CEA16749] import MED 3.0 files in SMESH: exception
This commit is contained in:
parent
550595c56d
commit
3421298e04
@ -211,7 +211,7 @@ namespace MED
|
||||
if (!CheckCompatibility(fileName)) {
|
||||
EXCEPTION(std::runtime_error, "Cannot open file '"<<fileName<<"'.");
|
||||
}
|
||||
return new MED::TWrapper(fileName);
|
||||
return new MED::TWrapper(fileName, false);
|
||||
}
|
||||
|
||||
PWrapper CrWrapperW(const std::string& fileName, int theVersion)
|
||||
@ -251,6 +251,6 @@ namespace MED
|
||||
CreateEmptyMEDFile(fileName, theVersion);
|
||||
}
|
||||
}
|
||||
return new MED::TWrapper(fileName, minor);
|
||||
return new MED::TWrapper(fileName, true, minor);
|
||||
}
|
||||
}
|
||||
|
@ -187,23 +187,20 @@ namespace MED
|
||||
|
||||
//---------------------------------------------------------------
|
||||
TWrapper
|
||||
::TWrapper(const std::string& theFileName, TInt theMinor):
|
||||
::TWrapper(const std::string& theFileName, bool write, TInt theMinor):
|
||||
myFile(new TFile(theFileName, theMinor)),
|
||||
myMinor(theMinor)
|
||||
{
|
||||
TErr aRet;
|
||||
myFile->Open(eLECTURE_ECRITURE, &aRet);
|
||||
// if (aRet < 0)
|
||||
// myFile->Close();
|
||||
// myFile->Open(eLECTURE_AJOUT, &aRet);
|
||||
// }
|
||||
if (aRet < 0) {
|
||||
myFile->Close();
|
||||
myFile->Open(eLECTURE, &aRet);
|
||||
if ( write ) {
|
||||
myFile->Open(eLECTURE_ECRITURE, &aRet);
|
||||
if (aRet < 0) {
|
||||
myFile->Close();
|
||||
myFile->Open(eCREATION, &aRet);
|
||||
}
|
||||
}
|
||||
if (aRet < 0) {
|
||||
myFile->Close();
|
||||
myFile->Open(eCREATION, &aRet);
|
||||
else {
|
||||
myFile->Open(eLECTURE, &aRet);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace MED
|
||||
TWrapper& operator=(const TWrapper&);
|
||||
|
||||
public:
|
||||
TWrapper(const std::string& theFileName, TInt theVersion=-1);
|
||||
TWrapper(const std::string& theFileName, bool write, TInt theVersion=-1);
|
||||
|
||||
virtual
|
||||
~TWrapper();
|
||||
|
Loading…
Reference in New Issue
Block a user