Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributePythonObject_i.cxx
index c3be0fedce7ea9c47d1c4a42e0b5ab81fb247417..2faab629daf2678ed678212a5c9c01908b5827d2 100644 (file)
 #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,8 +38,6 @@ char* SALOMEDS_AttributePythonObject_i::Store() {
   return aResult;
 }
 
-void SALOMEDS_AttributePythonObject_i::Restore(const char* value) {
-  char* aString = CORBA::string_dup(value);
-  SetObject(aString + 1, aString[0]=='s');
-  delete(aString);
+void SALOMEDS_AttributePythonObject_i::Restore(const char* theValue) {
+  SetObject(&theValue[1], theValue[0]=='s');
 }