Home » U++ Library support » TreeCtrl » Node id calculation after removal ?
Node id calculation after removal ? [message #41884] |
Mon, 03 February 2014 17:17  |
Runik
Messages: 5 Registered: February 2013 Location: France
|
Promising Member |
|
|
Hello,
Is there a way to have node ids recalculated after a node removal ?
Currently the removed node stays in the treecontrol in an undefined state, and the following node ids in the hierarchy aren't modified, leading to parent id trouble when you save treecontrol data to a file and load it back ...
I suppose it's performance related, but is there a way to overcome this ?
Thanks
Edit: maybe it'll be clearer with a little schema :
Original treecontrol :
root // id=0
|-node1 // id=1, parent id=0
| |-node1.1 // id=2, parent id=1
|-node2 // id=3, parent id=0
| |-node2.2 // id=4, parent id=3
After removal of node1.1 :
root // id=0
|-node1 // id=1, parent id=0
|-node2 // id=3, parent id=0
| |-node2.2 // id=4, parent id=3
After saving to a file and reloading
root // id=0
|-node1 // id=1, parent id=0
|-node2 // id=2, parent id=0
| |-node2.2 // id=3, parent id=3 // ASSERT triggered !
[Updated on: Mon, 03 February 2014 17:25] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 22:57:36 CEST 2025
Total time taken to generate the page: 0.00668 seconds
|