]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix names of the python variables for not published GEOM objects.
authorrnv <rnv@opencascade.com>
Tue, 1 Mar 2011 14:06:35 +0000 (14:06 +0000)
committerrnv <rnv@opencascade.com>
Tue, 1 Mar 2011 14:06:35 +0000 (14:06 +0000)
src/GEOM/GEOM_Engine.cxx

index 9fffbf9779b214de5cb039e451b6a2a6103514bc..6f830e15e7711b76985b00651f198194f675a7a8 100644 (file)
@@ -1305,27 +1305,28 @@ void ReplaceEntriesByNames (TCollection_AsciiString&                  theScript,
     theObjListToPublish.Append( anEntry );
     
     TObjectData& data = aEntry2ObjData[ anEntry ];
-    if ( !data._name.IsEmpty() ) { // published object
-      if ( data._pyName.IsEmpty() ) { // encounted for the 1st time
+    if ( data._pyName.IsEmpty() ) { // encounted for the 1st time
+      if ( !data._name.IsEmpty() ) { // published object
         data._pyName = data._name;
         healPyName( data._pyName, anEntry, aNameToEntry);
       }
+      else {
+       do {
+         data._pyName = aBaseName + TCollection_AsciiString(++objectCounter);
+       } while(aNameToEntry.IsBound(data._pyName));
+      }
     }
-    else {
-      do {
-        data._pyName = aBaseName + TCollection_AsciiString(++objectCounter);
-      } while(aNameToEntry.IsBound(data._pyName));
-    }
+    
     aNameToEntry.Bind(data._pyName, anEntry); // to detect same name of diff objects
-
+    
     anUpdatedScript += data._pyName;
     aStart = aSeq->Value(i+1) + 1;
   }
-
+  
   //Add final part of the script
   if (aLen && aSeq->Value(aLen) < aScriptLength)
     anUpdatedScript += theScript.SubString(aSeq->Value(aLen)+1, aScriptLength); // mkr : IPAL11865
-
+  
   theScript = anUpdatedScript;
 }