From ab99cd2215cb347c46ce484d3ba852a81aea0fb3 Mon Sep 17 00:00:00 2001 From: maintenance team Date: Thu, 7 Dec 2006 14:04:36 +0000 Subject: [PATCH] fix compilation on DebianSarge and RedHat --- src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx index e0c6cf669..994f39594 100644 --- a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx @@ -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(); } -- 2.39.2