From 60cf2eddb97e4570a62808cda304298550e3848f Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 30 Aug 2012 12:27:19 +0000 Subject: [PATCH] 0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement Fix problem with Object browser updating --- src/SUIT/SUIT_TreeModel.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 9e4558138..53c9a94ba 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -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(); -- 2.39.2