Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributePythonObject_i.cxx
index a02fa874eba13d2403b8cde375c32ec160dceb17..2faab629daf2678ed678212a5c9c01908b5827d2 100644 (file)
@@ -9,16 +9,15 @@
 //  Module : SALOME
 //  $Header$
 
-using namespace std;
 #include "SALOMEDS_AttributePythonObject_i.hxx"
 #include <TCollection_ExtendedString.hxx>
 #include <TColStd_HArray1OfCharacter.hxx>
-#include "SALOMEDS_SObject_i.hxx"
+
+using namespace std;
 
 void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) {
   CheckLocked();
-  char *aSeq = CORBA::string_dup(theSequence);
-  Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(aSeq, IsScript);
+  Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(const_cast<char*>(theSequence), IsScript);
 }
 
 char* SALOMEDS_AttributePythonObject_i::GetObject() {
@@ -39,7 +38,6 @@ char* SALOMEDS_AttributePythonObject_i::Store() {
   return aResult;
 }
 
-void SALOMEDS_AttributePythonObject_i::Restore(const char* value) {
-  char* aString = strdup(value);
-  SetObject(aString + 1, aString[0]=='s');
+void SALOMEDS_AttributePythonObject_i::Restore(const char* theValue) {
+  SetObject(&theValue[1], theValue[0]=='s');
 }