char* SALOMEDS_AttributePythonObject_i::GetObject()
{
SALOMEDS::Locker lock;
- char* aSeq = Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_impl)->GetObject().ToCString();
- CORBA::String_var aStr = CORBA::string_dup(aSeq);
- return aStr._retn();
+ TCollection_AsciiString aSeq(Handle(SALOMEDSImpl_AttributePythonObject)::
+ DownCast(_impl)->GetObject().ToCString());
+ return aSeq.ToCString();
+
}
CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript()
void SALOMEDSImpl_AttributePythonObject::SetObject(const TCollection_AsciiString& theSequence,
const bool theScript)
{
- CheckLocked();
+ CheckLocked();
Backup();
mySequence = theSequence;
myIsScript = theScript;
TCollection_AsciiString SALOMEDSImpl_AttributePythonObject::Save()
{
- char* aString = (char*)GetObject().ToCString();
- char* aResult = new char[strlen(aString) + 2];
- aResult[0] = IsScript()?'s':'n';
- strcpy(aResult+1, aString);
- TCollection_AsciiString ret(aResult);
+ TCollection_AsciiString aString = GetObject();
+ TCollection_AsciiString aResult = IsScript()?'s':'n';
+ aResult += aString;
- delete aResult;
- return ret;
+ return aResult;
}
void SALOMEDSImpl_AttributePythonObject::Load(const TCollection_AsciiString& value)