Salome HOME
NRI : Merge from V1_2.
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_AttributeTableOfString_i.cxx
index 6b8a1f4f72d4f023d569eb1d565448d7e46e0678..262cdce8d479a8fef833ed3f8834f9ee686a81e0 100644 (file)
@@ -1,12 +1,14 @@
-using namespace std;
-//  File      : SALOMEDS_AttributeTableOfString_i.cxx
-//  Created   : Mon Apr  7 10:13:30 2003
-//  Author    : Sergey Ruin
-//  Project   : SALOME
-//  Module    : SALOMEDS
-//  Copyright : Open CASCADE
-
+//  SALOME SALOMEDS : data structure of SALOME and sources of Salome data server 
+//
+//  Copyright (C) 2003  CEA/DEN, EDF R&D
+//
+//
+//
+//  File   : SALOMEDS_AttributeTableOfString_i.cxx
+//  Author : Sergey Ruin
+//  Module : SALOME
 
+using namespace std;
 #include <TCollection_ExtendedString.hxx>
 #include <TCollection_AsciiString.hxx>
 
@@ -307,22 +309,10 @@ SALOMEDS::TMPFile*  SALOMEDS_AttributeTableOfString_i::SaveToFile()
   Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr);
 
   ostrstream ostr;
-  string aString;
   aTable->ConvertToString(ostr);
-
-  aString = ostr.rdbuf()->str();
-
-  cout << " ######## STRLEN " << aString.size() << endl;
-
-  char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
-  int aBufferSize = strlen((char*)aBuffer);
-
-  cout << " ####### STRLEN " << aBufferSize  << endl;
-
-  CORBA::Octet* anOctetBuf =  (CORBA::Octet*)aBuffer;
-
-  SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1);
-
+  CORBA::Octet* anOctetBuf =  (CORBA::Octet*)ostr.rdbuf()->str();
+  unsigned long aSize = ostr.pcount();
+  SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(aSize, aSize, anOctetBuf, 1);
   return aStreamFile._retn();
 }