]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement
authorvsr <vsr@opencascade.com>
Thu, 30 Aug 2012 12:27:19 +0000 (12:27 +0000)
committervsr <vsr@opencascade.com>
Thu, 30 Aug 2012 12:27:19 +0000 (12:27 +0000)
Fix problem with Object browser updating

src/SUIT/SUIT_TreeModel.cxx

index 9e45581385b0201a3e381128fa200c99d7fc96c2..53c9a94ba94ebca5eafcb0722fe757acce19fc85 100755 (executable)
@@ -1326,10 +1326,7 @@ void SUIT_TreeModel::updateTreeModel(SUIT_DataObject* obj,TreeItem* item)
       if(sitem==0)
         {
           //end of item list
-          if(kitem==0)
-            sitem=createItemAtPos(sobj,item,0);
-          else
-            sitem=createItemAtPos(sobj,item,kitem);
+         sitem=createItemAtPos(sobj,item,kitem);
           updateTreeModel(sobj,sitem);
           kobj++;
           kitem++;
@@ -1347,7 +1344,8 @@ void SUIT_TreeModel::updateTreeModel(SUIT_DataObject* obj,TreeItem* item)
           else
             {
               // obj : new object
-              createItemAtPos(sobj,item,kitem);
+              sitem=createItemAtPos(sobj,item,kitem);
+             updateTreeModel(sobj,sitem);
               kobj++;
               kitem++;
               sobj=obj->childObject(kobj);
@@ -1359,7 +1357,7 @@ void SUIT_TreeModel::updateTreeModel(SUIT_DataObject* obj,TreeItem* item)
           //obj and item are synchronised : go to next ones
           updateTreeModel(sobj,sitem);
           if(sobj->modified()) updateItem(sitem, true);
-          if( sobj ) sobj->update();
+          sobj->update();
           kobj++;
           kitem++;
           sobj=obj->childObject(kobj);
@@ -1569,8 +1567,8 @@ SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItemAtPos( SUIT_DataObject* obj,
   SUIT_TreeModel::TreeItem* item = new TreeItem( obj, parent, after );
   myItems[ obj ] = item;
 
-  for(int pos=row;pos < parent->childCount();pos++)
-    parent->child(pos)->setPosition(pos);
+  for(int ppos=row;ppos < parent->childCount();ppos++)
+    parent->child(ppos)->setPosition(ppos);
 
   endInsertRows();