]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix for bug NPAL14900(Pb of performances with FindObjectIOR).
authormzn <mzn@opencascade.com>
Thu, 15 Feb 2007 09:40:52 +0000 (09:40 +0000)
committermzn <mzn@opencascade.com>
Thu, 15 Feb 2007 09:40:52 +0000 (09:40 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx

index f6c2fa1f6db92b51d30ce6864f771c63de3a0c82..e34aa990ad677333f6259e502891cea7e71c5da0 100644 (file)
@@ -343,44 +343,19 @@ Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_Study::FindObjectByName(const
 Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::FindObjectIOR(const TCollection_AsciiString& anObjectIOR)
 {
   _errorCode = "";
-
-  // firstly searching in the datamap for optimization
+  
+  Handle(SALOMEDSImpl_SObject) aResult = NULL;
+  
+  // searching in the datamap for optimization
   if (myIORLabels.IsBound(anObjectIOR)) {
-    Handle(SALOMEDSImpl_SObject) aResult = GetSObject(myIORLabels.Find(anObjectIOR));
+    aResult = GetSObject(myIORLabels.Find(anObjectIOR));
     // 11 oct 2002: forbidden attributes must be checked here
-    if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) {
+    if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID()))
       myIORLabels.UnBind(anObjectIOR);
-    } else
-      return aResult;
-  }
-  // Iterate to all components defined in the study
-  // After testing the component name, iterate in all objects defined under
-  // components (function _FindObject)
-  bool _find = false;
-  Handle(SALOMEDSImpl_SObject) RefSO = NULL;
-
-  SALOMEDSImpl_SComponentIterator it = NewComponentIterator();
-  Handle(SALOMEDSImpl_SComponent) SC;
-  for (; it.More();it.Next()){
-    if(!_find)
-      {
-       SC = it.Value();
-       TCollection_AsciiString ior = SC->GetIOR();
-       if (ior != "")
-       {
-         if (ior ==  anObjectIOR)
-           {
-             _find = true;
-             RefSO = SC;
-           }
-       }
-       if (!_find)
-         RefSO =  _FindObjectIOR(SC, anObjectIOR, _find);
-      }
   }
-
-  if(RefSO.IsNull()) _errorCode = "No object was found";
-  return RefSO;
+  
+  if(aResult.IsNull()) _errorCode = "No object was found";
+  return aResult;
 }
 
 //============================================================================