]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
fix compilation on DebianSarge and RedHat
authormaintenance team <salome-mnt@opencascade.com>
Thu, 7 Dec 2006 14:04:36 +0000 (14:04 +0000)
committermaintenance team <salome-mnt@opencascade.com>
Thu, 7 Dec 2006 14:04:36 +0000 (14:04 +0000)
src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx

index e0c6cf6692385bd2ac90bc71a4e362ee265a5bfa..994f39594cf867f6fb420eab33fb05bca0c58c39 100644 (file)
@@ -98,9 +98,14 @@ public:
   typename TInterface::_var_type LoadObjectFromStream( std::istream & stream )
   {
     if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
-      string str;
-      if (stream >> str)
-        return gen->GetObjectByOldId< TInterface >( atoi( str.c_str() ));
+      std::string str;
+      if (stream >> str) {
+        if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) {
+          string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
+          if ( !ior.empty() )
+             return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
+        }
+      }
     }
     return TInterface::_nil();
   }