Fix typecasting in address->compound node case.

- In the special case of an address node with a hidden child, we
  must send notifications for removal of the hidden compound's
  children rather than for the hidden node itself. Otherwise the
  base TreeTable's state gets out of sync, leading to a crash when
  attempting to typecast such a node.
This commit is contained in:
Rene Gollent
2012-11-30 20:23:39 -05:00
parent 9010bda0c8
commit 6be1e373d5
@@ -1030,6 +1030,17 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
if (modelNode == NULL)
return;
// in the case of an address node with a hidden child,
// we want to send removal notifications for the children
// instead.
if (modelNode->CountChildren() == 1
&& modelNode->ChildAt(0)->IsHidden()) {
ModelNode* tempNode = modelNode->ChildAt(0);
modelNode->RemoveChild(tempNode);
modelNode = tempNode;
fNodeTable.Remove(tempNode);
}
for (int32 i = 0; i < modelNode->CountChildren(); i++) {
BReference<ModelNode> childNode = modelNode->ChildAt(i);
TreeTablePath treePath;