Salome HOME
MPV:
authormpv <mpv@opencascade.com>
Thu, 3 Feb 2005 08:12:34 +0000 (08:12 +0000)
committermpv <mpv@opencascade.com>
Thu, 3 Feb 2005 08:12:34 +0000 (08:12 +0000)
Fix for bug PAL7956:
Don not chechLock on CORBA attribute creation (without OCAF document modifications)

src/SALOMEDS/SALOMEDS_SObject_i.cxx
src/SALOMEDS/SALOMEDS_SObject_i.hxx

index dc4426a71bc90032b81171cc2db9a6aac80f69ec..35c5087af6385c4a68b45df0c587372444155b63 100644 (file)
@@ -577,8 +577,8 @@ SALOMEDS_SObject_i::_CreateGenAttribute(const Handle(TDF_Attribute)& theAttr,
   if(anIter != __AttrID2FunMap__.end()){
     const TAttrID2FunMap::mapped_type& aValue = anIter->second;
     
-    if(aValue.myIsCheckLockedStudy())
-      _study->CheckLocked();
+    //if(aValue.myIsCheckLockedStudy()) // mpv 03.02.05: creation of CORBA objects does not modify the study
+    //  _study->CheckLocked();
     
     anAttr = aValue.myNewInstance(theAttr,this);
     return TAttrHolder(anAttr,anAttr->_this());
@@ -631,25 +631,17 @@ SALOMEDS_SObject_i::_FindGenAttribute(const char* theType)
 }
 
 
-SALOMEDS::GenericAttribute_ptr 
-SALOMEDS_SObject_i::_FindCORBAAttribute(const char* theType)
+CORBA::Boolean 
+SALOMEDS_SObject_i::FindAttribute(SALOMEDS::GenericAttribute_out theAttribute, 
+                                 const char* theType)
 {
   TAttrHolder anAttr = _FindGenAttribute(theType);
   SALOMEDS::GenericAttribute_var anGenAttr = anAttr.second;
   if(!CORBA::is_nil(anGenAttr)){
-    return anGenAttr._retn();
+    theAttribute = SALOMEDS::GenericAttribute::_duplicate(anGenAttr);
+    return true;
   }
-
-  return SALOMEDS::GenericAttribute::_nil();
-}
-
-
-CORBA::Boolean 
-SALOMEDS_SObject_i::FindAttribute(SALOMEDS::GenericAttribute_out theAttribute, 
-                                 const char* theType)
-{
-  theAttribute = _FindCORBAAttribute(theType);
-  return !CORBA::is_nil(theAttribute);
+  return false;
 }
 
 
index 45ff3e5d3ac0d95075015d2ce771c1914a9592ef..c5f534180e85248607f5567ac8327b86f723266b 100644 (file)
@@ -135,9 +135,6 @@ protected:
   TAttrHolder 
   _FindGenAttribute(const char* theTypeOfAttribute);
 
-  SALOMEDS::GenericAttribute_ptr 
-  _FindCORBAAttribute(const char* theTypeOfAttribute);
-
   Handle(TDF_Attribute) 
     _AddAttribute(const char* theTypeOfAttribute);