From 002d5e97298f6fa8dabc3123ab5a9575133b25a4 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 4 Jul 2011 02:34:08 +0000 Subject: [PATCH] Only mark a compound child hidden if it is in fact the only child present. Interesting side effects otherwise occur in the case where multiple compound children are present, since other areas of the table model depend on the node only being hidden in the single child case. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42367 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../gui/team_window/VariablesView.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index 4ac7c0e863..e1d8f53f62 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -392,7 +392,8 @@ private: status_t _AddNode(Variable* variable, ModelNode* parent, ValueNodeChild* nodeChild, - bool isPresentationNode = false); + bool isPresentationNode = false, + bool isOnlyChild = false); void _AddNode(Variable* variable); status_t _CreateValueNode(ValueNodeChild* nodeChild); status_t _AddChildNodes(ValueNodeChild* nodeChild); @@ -819,7 +820,7 @@ VariablesView::VariableTableModel::ValueNodeChildrenCreated( ValueNodeChild* child = valueNode->ChildAt(i); if (fNodeTable.Lookup(child) == NULL) { _AddNode(modelNode->GetVariable(), modelNode, child, - child->IsInternal()); + child->IsInternal(), childCount == 1); } } } @@ -1003,7 +1004,8 @@ VariablesView::VariableTableModel::NotifyNodeChanged(ModelNode* node) status_t VariablesView::VariableTableModel::_AddNode(Variable* variable, - ModelNode* parent, ValueNodeChild* nodeChild, bool isPresentationNode) + ModelNode* parent, ValueNodeChild* nodeChild, bool isPresentationNode, + bool isOnlyChild) { // Don't create nodes for unspecified types -- we can't get/show their // value anyway. @@ -1036,8 +1038,9 @@ VariablesView::VariableTableModel::_AddNode(Variable* variable, fNodeTable.Insert(node); - // mark a compound type child of a address type parent hidden - if (parent != NULL) { + // if an address type node has only a single child, and that child + // is a compound type, mark it hidden + if (isOnlyChild && parent != NULL) { ValueNode* parentValueNode = parent->NodeChild()->Node(); if (parentValueNode != NULL && parentValueNode->GetType()->ResolveRawType(false)->Kind()