From: apo Date: Fri, 30 May 2008 10:49:32 +0000 (+0000) Subject: Fix for Bug IPAL17668 X-Git-Tag: V4_1_3rc1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bd7e5434e9a94fd525ef0015c65ae5446a669ac1;p=modules%2Fvisu.git Fix for Bug IPAL17668 - TC71: REGR: copy object leads to fatal error and unknown exception (minor coding improvements) --- 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);