Salome HOME
54524: [FORUM]: Export in STL work wrong' issue
authoreap <eap@opencascade.com>
Mon, 1 Apr 2019 15:39:56 +0000 (18:39 +0300)
committereap <eap@opencascade.com>
Mon, 1 Apr 2019 15:39:56 +0000 (18:39 +0300)
src/SMESHUtils/SMESH_File.cxx
src/SMESH_I/SMESH_Mesh_i.cxx

index 888de19..a8983d2 100644 (file)
@@ -319,6 +319,8 @@ bool SMESH_File::getInts(std::vector<int>& ints)
 
 bool SMESH_File::openForWriting()
 {
+  close();
+
 #ifdef WIN32
 #ifdef UNICODE
   std::wstring  aName = Kernel_Utils::utf8_decode_s(_name);
index 8b7485f..67daefb 100644 (file)
@@ -3283,9 +3283,9 @@ CORBA::Boolean SMESH_Mesh_i::HasDuplicatedGroupNamesMED()
 
 void SMESH_Mesh_i::PrepareForWriting (const char* file, bool overwrite)
 {
-  SMESH_File aFile( file , false );
+  SMESH_File aFile( file, false );
   SMESH_Comment msg;
-  if (aFile.exists()) {
+  if ( aFile.exists() ) {
     // existing filesystem node
     if ( !aFile.isDirectory() ) {
       if ( aFile.openForWriting() ) {