| 567 | } |
| 568 | |
| 569 | bool CFavoriteModel::tree::InsertChild(int index, tree *child) |
| 570 | { |
| 571 | if(0 > index || ChildCount() < index || !child) |
| 572 | return false; |
| 573 | children.insert(index, child); |
| 574 | child->parent = this; |
| 575 | // 更新剩余子节点的行号 |
| 576 | for (int i = index; i < ChildCount(); ++i) { |
| 577 | children[i]->SetRow(i); |
| 578 | } |
| 579 | return true; |
| 580 | } |
| 581 | |
| 582 | bool CFavoriteModel::tree::RemoveChild(tree *child) |
| 583 | { |