Salome HOME
Merge changes from 'master' branch.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributePythonObject.cxx
index 789dd361812f4d1c2667e976b697adafa68a956c..f69050cc080630aa413ff21b48e54b5945817e07 100644 (file)
@@ -1,34 +1,35 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SALOMEDS_AttributePythonObject.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
+//
 #include "SALOMEDS_AttributePythonObject.hxx"
 #include "SALOMEDS.hxx"
 
 #include <string>
-#include <TCollection_AsciiString.hxx> 
-#include <TCollection_ExtendedString.hxx>
 
-SALOMEDS_AttributePythonObject::SALOMEDS_AttributePythonObject(const Handle(SALOMEDSImpl_AttributePythonObject)& theAttr)
+SALOMEDS_AttributePythonObject::SALOMEDS_AttributePythonObject(SALOMEDSImpl_AttributePythonObject* theAttr)
 :SALOMEDS_GenericAttribute(theAttr)
 {}
 
@@ -44,7 +45,7 @@ bool SALOMEDS_AttributePythonObject::IsScript()
   bool ret;
   if (_isLocal) {
     SALOMEDS::Locker lock;
-    ret = Handle(SALOMEDSImpl_AttributePythonObject)::DownCast(_local_impl)->IsScript();
+    ret = dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_local_impl)->IsScript();
   }
   else ret = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->IsScript();
   return ret;
@@ -55,8 +56,7 @@ std::string SALOMEDS_AttributePythonObject::GetObject()
   std::string aValue;
   if (_isLocal) {
     SALOMEDS::Locker lock;
-    aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePythonObject)::
-                                     DownCast(_local_impl)->GetObject()).ToCString();
+    aValue = dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_local_impl)->GetObject().c_str();
   }
   else aValue = SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->GetObject();
   return aValue;
@@ -67,8 +67,7 @@ void SALOMEDS_AttributePythonObject::SetObject(const std::string& theSequence, b
   if (_isLocal) {
     CheckLocked();
     SALOMEDS::Locker lock;
-    Handle(SALOMEDSImpl_AttributePythonObject)::
-      DownCast(_local_impl)->SetObject((char*)theSequence.c_str(), IsScript);
+    dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_local_impl)->SetObject(theSequence, IsScript);
   }
   else SALOMEDS::AttributePythonObject::_narrow(_corba_impl)->SetObject(theSequence.c_str(), IsScript);
 }