Fix oversight in set visible range support.
Detect the case where we have a pointer to an array type, as seen when typecasting a pointer to an array, and present the set visible range option for these as well.
This commit is contained in:
@@ -1593,6 +1593,9 @@ VariablesView::MessageReceived(BMessage* message)
|
|||||||
->SelectionModel()->NodeAt(0);
|
->SelectionModel()->NodeAt(0);
|
||||||
int32 lowerBound, upperBound;
|
int32 lowerBound, upperBound;
|
||||||
ValueNode* valueNode = node->NodeChild()->Node();
|
ValueNode* valueNode = node->NodeChild()->Node();
|
||||||
|
if (!valueNode->IsRangedContainer())
|
||||||
|
valueNode = node->ChildAt(0)->NodeChild()->Node();
|
||||||
|
|
||||||
if (valueNode->SupportedChildRange(lowerBound, upperBound) != B_OK)
|
if (valueNode->SupportedChildRange(lowerBound, upperBound) != B_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1623,6 +1626,8 @@ VariablesView::MessageReceived(BMessage* message)
|
|||||||
->SelectionModel()->NodeAt(0);
|
->SelectionModel()->NodeAt(0);
|
||||||
int32 lowerBound, upperBound;
|
int32 lowerBound, upperBound;
|
||||||
ValueNode* valueNode = node->NodeChild()->Node();
|
ValueNode* valueNode = node->NodeChild()->Node();
|
||||||
|
if (!valueNode->IsRangedContainer())
|
||||||
|
valueNode = node->ChildAt(0)->NodeChild()->Node();
|
||||||
if (valueNode->SupportedChildRange(lowerBound, upperBound) != B_OK)
|
if (valueNode->SupportedChildRange(lowerBound, upperBound) != B_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1992,12 +1997,22 @@ VariablesView::_GetContextActionsForNode(ModelNode* node,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
ValueNode* valueNode = node->NodeChild()->Node();
|
ValueNode* valueNode = node->NodeChild()->Node();
|
||||||
if (valueNode != NULL && valueNode->IsRangedContainer()) {
|
if (valueNode == NULL)
|
||||||
|
return B_OK;
|
||||||
|
|
||||||
|
if (!valueNode->IsRangedContainer()) {
|
||||||
|
if (node->CountChildren() == 1 && node->ChildAt(0)->IsHidden()) {
|
||||||
|
valueNode = node->ChildAt(0)->NodeChild()->Node();
|
||||||
|
if (valueNode == NULL || !valueNode->IsRangedContainer())
|
||||||
|
return B_OK;
|
||||||
|
} else
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
result = _AddContextAction("Set visible range" B_UTF8_ELLIPSIS,
|
result = _AddContextAction("Set visible range" B_UTF8_ELLIPSIS,
|
||||||
MSG_SHOW_CONTAINER_RANGE_PROMPT, actions, message);
|
MSG_SHOW_CONTAINER_RANGE_PROMPT, actions, message);
|
||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user