From bd7e5434e9a94fd525ef0015c65ae5446a669ac1 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 30 May 2008 10:49:32 +0000 Subject: [PATCH] Fix for Bug IPAL17668 - TC71: REGR: copy object leads to fatal error and unknown exception (minor coding improvements) --- src/VISU_I/VISU_Gen_i.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 7a6a0016..c1a385e8 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -1391,14 +1391,11 @@ namespace VISU SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false); if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<length()); - std::string aLocalPersistentID; + std::ostrstream aLocalPersistentID; { std::string aCopyPersist = aTmpDir + "copy_persistent"; - std::ifstream anInputFileStream(aCopyPersist.c_str()); - std::ostrstream anOutputStream; - anInputFileStream >> anOutputStream.rdbuf(); - aLocalPersistentID = anOutputStream.str(); - anInputFileStream.close(); + std::ifstream anInputFileStream( aCopyPersist.c_str() ); + anInputFileStream >> aLocalPersistentID.rdbuf(); } //Just for Result::Restore to find the Comment attribute :( @@ -1407,7 +1404,7 @@ namespace VISU std::string aFileName(aTmpDir); if(aListOfFileNames->length() > 1) aFileName += aListOfFileNames[1].in(); - Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID, aFileName, false); + Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID.str(), aFileName, false); SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames; aFilesToRemove->length(1); -- 2.39.2