Salome HOME
fix problem with SALOMEDS_Server bug
authormpa <mpa@opencascade.com>
Fri, 13 Jan 2017 12:50:54 +0000 (15:50 +0300)
committermpa <mpa@opencascade.com>
Fri, 13 Jan 2017 12:50:54 +0000 (15:50 +0300)
src/SALOMEDS/SALOMEDS.cxx
src/SALOMEDS/SALOMEDS_Server.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx

index 695992deb0208b3498cd914b929a83c9493f062f..23e4f3a20a95161463f7f6d1757eb0463bebcfb3 100644 (file)
@@ -118,8 +118,10 @@ extern "C"
       namingService.Register(aStudy, "/Study");
 
       // Assign the value of the IOR in the study->root
-      CORBA::String_var IORStudy = orb->object_to_string(aStudy);
-      aStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in());
+      if ( aStudy_i->GetImpl()->GetTransientReference().empty() ) {
+        CORBA::String_var IORStudy = orb->object_to_string(aStudy);
+        aStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in());
+      }
       aStudy_i->_remove_ref();
     }
   }
index 21db9a8c0552935939fca27d686f80ea3f1122bf..addbbba1af426dca841cefbb67355a19f88eea4d 100644 (file)
@@ -166,11 +166,13 @@ int main(int argc, char** argv)
         NS = SINGLETON_<SALOME_NamingService>::Instance();
         NS->init_orb( orb );
       }
-      NS->Register(Study.in(), "/Study");
+      NS->Register(Study, "/Study");
 
       // Assign the value of the IOR in the study->root
-      CORBA::String_var IORStudy = orb->object_to_string(Study);
-      myStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in());
+      if ( myStudy_i->GetImpl()->GetTransientReference().empty() ) {
+        CORBA::String_var IORStudy = orb->object_to_string(Study);
+        myStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in());
+      }
 
       myStudy_i->_remove_ref();
        
index 6e1e77792a3c13d5db00689f0efad5bb2ec5ac76..42bc8839b3ce665b5df35c03dcd46438fb044ebe 100644 (file)
@@ -522,7 +522,7 @@ bool SALOMEDSImpl_Study::Impl_SaveAs(const std::string& aStudyUrl,
   std::string component_name;
 
   // Store previous URL
-  std::string anOldName = Name();
+  std::string anOldName = URL();
 
   // Map to store components' versions
   std::map<std::string, std::string> componentVersions;