]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Yet another modification (this one from JFA) to fix the same problem: GetCommonParame...
authorasv <asv@opencascade.com>
Wed, 2 Aug 2006 08:34:55 +0000 (08:34 +0000)
committerasv <asv@opencascade.com>
Wed, 2 Aug 2006 08:34:55 +0000 (08:34 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx

index d6d6fcd17d41d817a871870d609838e1de8298b5..373212d852fb2869db4eb3f5cdb9801dfbf0e018 100644 (file)
@@ -1527,28 +1527,25 @@ void SALOMEDSImpl_Study::Modify()
 //============================================================================
 Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_Study::GetCommonParameters(const char* theID, int theSavePoint)
 {
-if(theSavePoint < 0) return NULL;\r
+  if (theSavePoint < 0) return NULL;\r
   Handle(SALOMEDSImpl_StudyBuilder) builder = NewBuilder();\r
   Handle(SALOMEDSImpl_SObject) so = FindComponent((char*)theID);\r
-  if(so.IsNull()) so = builder->NewComponent((char*)theID); \r
+  if (so.IsNull()) so = builder->NewComponent((char*)theID);\r
   Handle(SALOMEDSImpl_AttributeParameter) attParam;\r
-  if(theSavePoint == 0) { //Get an attribute that is placed on the component itself.\r
-    builder->FindAttribute(so, attParam, "AttributeParameter");\r
-       if ( attParam.IsNull() ) { // first call of GetCommonParameters on "Interface Applicative" component\r
-         Handle(TDF_Attribute) att = builder->FindOrCreateAttribute(so, "AttributeParameter");\r
-         attParam = Handle(SALOMEDSImpl_AttributeParameter)::DownCast( att );\r
-       }\r
-  }\r
-  else {  // Try to find SObject that contains attribute parameter ...\r
+\r
+  if (theSavePoint > 0) { // Try to find SObject that contains attribute parameter ...\r
     TDF_Label savePointLabel = so->GetLabel().FindChild( theSavePoint, /*create=*/0 );\r
-       if ( !savePointLabel.IsNull() ) {\r
-         so = GetSObject( savePointLabel );\r
-         builder->FindAttribute(so, attParam, "AttributeParameter");\r
-       } // ... if it does not exist - create a new one\r
-       else {\r
-         so = builder->NewObjectToTag( so, theSavePoint );\r
-         Handle(TDF_Attribute) att = builder->FindOrCreateAttribute(so, "AttributeParameter");\r
-         attParam = Handle(SALOMEDSImpl_AttributeParameter)::DownCast( att );\r
+    if ( !savePointLabel.IsNull() )\r
+      so = GetSObject( savePointLabel );\r
+    else // ... if it does not exist - create a new one\r
+      so = builder->NewObjectToTag( so, theSavePoint );\r
+  }\r
+\r
+  if (!so.IsNull()) {\r
+    builder->FindAttribute(so, attParam, "AttributeParameter");\r
+    if ( attParam.IsNull() ) { // first call of GetCommonParameters on "Interface Applicative" component\r
+      Handle(TDF_Attribute) att = builder->FindOrCreateAttribute(so, "AttributeParameter");\r
+      attParam = Handle(SALOMEDSImpl_AttributeParameter)::DownCast( att );\r
     }\r
   }\r
   return attParam;\r